Added THREADSPECIFIC define.
authortwisti <none@none>
Thu, 10 Feb 2005 10:43:41 +0000 (10:43 +0000)
committertwisti <none@none>
Thu, 10 Feb 2005 10:43:41 +0000 (10:43 +0000)
src/threads/green/threads.h
src/threads/native/threads.h

index d9c0b941913be4473ac0d84c009fb2f7c1771c33..55a657bd5a2114f29cc2282eabeb6e93f7f5f76e 100644 (file)
@@ -41,6 +41,7 @@
 #define THREAD_FLAGS_USER_SUSPEND       2  /* Flag explicit suspend() call */
 #define        THREAD_FLAGS_KILLED             4
 
+#define THREADSPECIFIC
 
 #define MAXTHREADS              256          /* schani */
 
index 41389976f0d6ba577d1d7346d76f6e578cf414b9..1e7e85698562829a14acbe0d03cc80b0b10978d5 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Stefan Ring
 
-   $Id: threads.h 1790 2004-12-21 10:11:23Z twisti $
+   $Id: threads.h 1923 2005-02-10 10:43:41Z twisti $
 
 */
 
 #endif
 
 
+#if defined(HAVE___THREAD)
+
+#define THREADSPECIFIC    __thread
+#define THREADOBJECT      ((java_lang_VMThread*) threadobj)
+#define THREADINFO        (&threadobj->info)
+
+extern __thread threadobject *threadobj;
+
+#else /* defined(HAVE___THREAD) */
+
+#define THREADSPECIFIC
+#define THREADOBJECT ((java_lang_VMThread*) pthread_getspecific(tkey_threadinfo))
+#define THREADINFO (&((threadobject*) pthread_getspecific(tkey_threadinfo))->info)
+
+extern pthread_key_t tkey_threadinfo;
+
+#endif /* defined(HAVE___THREAD) */
+
+
 /* typedefs *******************************************************************/
 
 typedef struct ExecEnvironment ExecEnvironment;
@@ -163,17 +182,6 @@ void interruptThread(java_lang_VMThread *);
 bool interruptedThread();
 bool isInterruptedThread(java_lang_VMThread *);
 
-#if !defined(HAVE___THREAD)
-extern pthread_key_t tkey_threadinfo;
-#define THREADOBJECT ((java_lang_VMThread*) pthread_getspecific(tkey_threadinfo))
-#define THREADINFO (&((threadobject*) pthread_getspecific(tkey_threadinfo))->info)
-#else
-extern __thread threadobject *threadobj;
-#define THREADOBJECT ((java_lang_VMThread*) threadobj)
-#define THREADINFO (&threadobj->info)
-#endif
-
-
 /* This must not be changed, it is used in asm_criticalsections */
 typedef struct {
        u1 *mcodebegin;