* Written by Tim Wilkinson <tim@tjwassoc.demon.co.uk>, 1996.
*/
-#include "global.h"
-
-#if !defined(NATIVE_THREADS)
-
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include "config.h"
-#include "exceptions.h"
-#include "thread.h"
-#include "locks.h"
-#include "tables.h"
-#include "native.h"
-#include "loader.h"
-#include "builtin.h"
-#include "asmpart.h"
-#include "options.h"
-#include "toolbox/logging.h"
-#include "toolbox/memory.h"
+#include "mm/memory.h"
+#include "native/native.h"
+#include "threads/green/locks.h"
+#include "threads/green/threads.h"
#include "toolbox/avl.h"
+#include "toolbox/logging.h"
+#include "vm/builtin.h"
+#include "vm/exceptions.h"
+#include "vm/global.h"
+#include "vm/loader.h"
+#include "vm/options.h"
+#include "vm/tables.h"
+#include "vm/jit/asmpart.h"
+
static classinfo *class_java_lang_ThreadDeath;
utf_new_char("(Ljava/lang/Thread;)V"));
if (!m) { /* initializer not found */
- if (verbose) {
+ if (opt_verbose) {
char logtext[MAXLOGTEXT];
sprintf(logtext, "Warning: class has no instance-initializer: ");
utf_sprint_classname(logtext + strlen(logtext), c->name);
{
}
-#endif
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */
* Written by Tim Wilkinson <tim@tjwassoc.demon.co.uk>, 1996.
*/
-#ifndef _THREAD_H
-#define _THREAD_H
-
-#include "config.h"
+#ifndef _THREADS_H
+#define _THREADS_H
-#ifdef USE_THREADS
+#include "config.h"
+#include "mm/memory.h"
+#include "vm/global.h" /* for native includes */
+#include "native/include/java_lang_ClassLoader.h"
+#include "native/include/java_lang_String.h"
+#include "native/include/java_lang_Throwable.h"
-#include "global.h"
#define THREADCLASS "java/lang/Thread"
#define THREADGROUPCLASS "java/lang/ThreadGroup"
#define THREAD_FLAGS_USER_SUSPEND 2 /* Flag explicit suspend() call */
#define THREAD_FLAGS_KILLED 4
-#if !defined(NATIVE_THREADS)
#define MAXTHREADS 256 /* schani */
} threadGroup;
-
-/* This structure mirrors java.lang.VMThread.h */
-typedef struct vmthread {
- java_objectheader header;
- struct _thread* thread;
- s4 running;
- s4 status;
- s4 priority;
- void* restorePoint;
- void* stackMem;
- void* stackBase;
- void* stackEnd;
- void* usedStackTop;
- s8 time;
- java_objectheader *texceptionptr;
- struct _thread* nextlive;
- struct _thread* next;
- s4 flags;
-} vmthread;
+typedef struct thread thread;
+typedef struct vmthread vmthread;
/* This structure mirrors java.lang.Thread.h */
-typedef struct _thread {
- java_objectheader header;
- vmthread* vmThread;
- threadGroup* group;
+
+struct thread {
+ java_objectheader header;
+ vmthread *vmThread;
+ threadGroup *group;
struct java_lang_Runnable* runnable;
- struct java_lang_String* name;
- s4 daemon;
- s4 priority;
- s8 stacksize;
- struct java_lang_Throwable* stillborn;
- struct java_lang_ClassLoader* contextClassLoader;
-} thread;
+ java_lang_String *name;
+ s4 daemon;
+ s4 priority;
+ s8 stacksize;
+ java_lang_Throwable *stillborn;
+ java_lang_ClassLoader *contextClassLoader;
+};
-void initThreads (u1 *stackbottom);
-void clear_thread_flags (void);
-void startThread (thread*);
-void resumeThread (thread*);
-void iresumeThread (thread*);
-void suspendThread (thread*);
-void suspendOnQThread (thread*, thread**);
-void yieldThread (void);
-void killThread (thread*);
-void setPriorityThread (thread*, int);
-s8 currentTime (void);
-void sleepThread(s8 millis, s4 nanos);
-bool aliveThread (thread*);
-long framesThread (thread*);
+/* This structure mirrors java.lang.VMThread.h */
-void reschedule (void);
+struct vmthread {
+ java_objectheader header;
+ thread *thread;
+ s4 running;
+ s4 status;
+ s4 priority;
+ void *restorePoint;
+ void *stackMem;
+ void *stackBase;
+ void *stackEnd;
+ void *usedStackTop;
+ s8 time;
+ java_objectheader *texceptionptr;
+ struct _thread *nextlive;
+ struct _thread *next;
+ s4 flags;
+
+#if 0
+ dumpinfo *dumpinfo; /* dump memory info structure */
+#endif
+};
-void checkEvents (bool block);
extern int blockInts;
extern bool needReschedule;
} while(0)
-/* function prototypes */
-void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop);
-u1* asm_initialize_thread_stack(void *func, u1 *stack);
+/* function prototypes ********************************************************/
-#else /* NATIVE_THREADS */
-#include "nativethread.h"
-#endif
+void initThreads (u1 *stackbottom);
+void clear_thread_flags (void);
+void startThread (thread*);
+void resumeThread (thread*);
+void iresumeThread (thread*);
+void suspendThread (thread*);
+void suspendOnQThread (thread*, thread**);
+void yieldThread (void);
+void killThread (thread*);
+void setPriorityThread (thread*, int);
-#else
+s8 currentTime (void);
+void sleepThread(s8 millis, s4 nanos);
+bool aliveThread (thread*);
+long framesThread (thread*);
+
+void reschedule (void);
-#define intsDisable()
-#define intsRestore()
+void checkEvents (bool block);
-#endif /* USE_THREADS */
+#endif /* _THREADS_H */
-#endif /* _THREAD_H */
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */