* configure.ac (--enable-vmlog): New configure option.
[cacao.git] / src / threads / native / threads.h
index 023fc7050f156ef79f8dcd6b7c22be80f58b8b28..53f34831d383b2348d98b6d7cee5c112c2047960 100644 (file)
@@ -1,6 +1,6 @@
 /* src/threads/native/threads.h - native threads header
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
    J. Wenninger, Institut f. Computersprachen - TU Wien
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Stefan Ring
-            Edwin Steiner
-            Christian Thalinger
-
-   $Id: threads.h 6228 2006-12-26 19:56:58Z twisti $
+   $Id: threads.h 7761 2007-04-19 09:18:20Z twisti $
 
 */
 
@@ -53,10 +47,13 @@ typedef struct threads_table_t       threads_table_t;
 #include "mm/memory.h"
 #include "native/jni.h"
 #include "native/include/java_lang_Thread.h"
-#include "vm/global.h"
 
 #include "threads/native/lock.h"
 
+#include "vm/global.h"
+
+#include "vm/jit/stacktrace.h"
+
 #if defined(ENABLE_INTRP)
 #include "vm/jit/intrp/intrp.h"
 #endif
@@ -75,13 +72,6 @@ typedef struct {
 #endif
 
 
-/* thread priorities **********************************************************/
-
-#define MIN_PRIORITY     1
-#define NORM_PRIORITY    5
-#define MAX_PRIORITY     10
-
-
 /* current threadobject *******************************************************/
 
 #if defined(HAVE___THREAD)
@@ -130,17 +120,17 @@ struct threads_table_t {
 
 /* threadobject ****************************************************************
 
-   Every java.lang.Thread object is actually an instance of this
-   structure.
+   Struct holding thread local variables.
 
 *******************************************************************************/
 
 #define THREAD_FLAG_JAVA        0x01    /* a normal Java thread               */
 #define THREAD_FLAG_INTERNAL    0x02    /* CACAO internal thread              */
+#define THREAD_FLAG_DAEMON      0x04    /* daemon thread                      */
 
 
 struct threadobject {
-       java_lang_Thread      o;            /* the java.lang.Thread object        */
+       java_lang_Thread     *object;       /* link to java.lang.Thread object    */
 
        lock_execution_env_t  ee;           /* data for the lock implementation   */
 
@@ -150,7 +140,8 @@ struct threadobject {
        ptrint                thinlock;     /* pre-computed thin lock value       */
 
        s4                    index;        /* thread index, starting with 1      */
-       u1                    flags;        /* flag field                         */
+       u4                    flags;        /* flag field                         */
+       u4                    state;        /* state field                        */
 
        pthread_t             tid;          /* pthread id                         */
 
@@ -158,9 +149,6 @@ struct threadobject {
        mach_port_t           mach_thread;       /* Darwin thread id              */
 #endif
 
-       pthread_mutex_t       joinmutex;
-       pthread_cond_t        joincond;
-
        /* these are used for the wait/notify implementation                      */
        pthread_mutex_t       waitmutex;
        pthread_cond_t        waitcond;
@@ -183,6 +171,16 @@ struct threadobject {
 };
 
 
+/* exception pointer **********************************************************/
+
+#define exceptionptr      (&(THREADOBJECT->_exceptionptr))
+
+
+/* stackframeinfo *************************************************************/
+
+#define STACKFRAMEINFO    (THREADOBJECT->_stackframeinfo)
+
+
 /* variables ******************************************************************/
 
 extern threadobject *mainthreadobj;
@@ -220,8 +218,6 @@ bool threads_thread_has_been_interrupted(threadobject *thread);
 void threads_cast_stopworld(void);
 void threads_cast_startworld(void);
 
-void threads_dump(void);
-
 #endif /* _THREADS_H */