aboutsummaryrefslogtreecommitdiff
path: root/libjava/include/posix-threads.h
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/include/posix-threads.h')
-rw-r--r--libjava/include/posix-threads.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/libjava/include/posix-threads.h b/libjava/include/posix-threads.h
index a268f1d..79961c2 100644
--- a/libjava/include/posix-threads.h
+++ b/libjava/include/posix-threads.h
@@ -221,14 +221,6 @@ _Jv_ThreadCurrent (void)
// to threads.
-#ifdef __i386__
-
-#define SLOW_PTHREAD_SELF
- // Add a cache for pthread_self() if we don't have the thread
- // pointer in a register.
-
-#endif /* __i386__ */
-
#ifdef __ia64__
typedef size_t _Jv_ThreadId_t;
@@ -270,6 +262,8 @@ _Jv_ThreadSelf (void)
#if defined(SLOW_PTHREAD_SELF)
+#include "sysdep/locks.h"
+
typedef pthread_t _Jv_ThreadId_t;
// E.g. on X86 Linux, pthread_self() is too slow for our purpose.
@@ -321,7 +315,7 @@ _Jv_ThreadSelf (void)
unsigned h = SC_INDEX(sp);
volatile self_cache_entry *sce = _Jv_self_cache + h;
pthread_t candidate_self = sce -> self; // Read must precede following one.
- // Read barrier goes here, if needed.
+ read_barrier();
if (sce -> high_sp_bits == sp >> LOG_THREAD_SPACING)
{
// The sce -> self value we read must be valid. An intervening