1.1 --- a/src/os/bsd/vm/osThread_bsd.hpp Fri May 18 09:15:15 2012 -0700 1.2 +++ b/src/os/bsd/vm/osThread_bsd.hpp Tue May 22 10:11:53 2012 +0200 1.3 @@ -42,26 +42,19 @@ 1.4 #ifdef _ALLBSD_SOURCE 1.5 1.6 #ifdef __APPLE__ 1.7 - thread_t _thread_id; 1.8 + typedef thread_t thread_id_t; 1.9 #else 1.10 - pthread_t _thread_id; 1.11 + typedef pthread_t thread_id_t; 1.12 +#endif 1.13 + 1.14 +#else 1.15 + typedef pid_t thread_id_t; 1.16 #endif 1.17 1.18 // _pthread_id is the pthread id, which is used by library calls 1.19 // (e.g. pthread_kill). 1.20 pthread_t _pthread_id; 1.21 1.22 -#else 1.23 - // _thread_id is kernel thread id (similar to LWP id on Solaris). Each 1.24 - // thread has a unique thread_id (BsdThreads or NPTL). It can be used 1.25 - // to access /proc. 1.26 - pid_t _thread_id; 1.27 - 1.28 - // _pthread_id is the pthread id, which is used by library calls 1.29 - // (e.g. pthread_kill). 1.30 - pthread_t _pthread_id; 1.31 -#endif 1.32 - 1.33 sigset_t _caller_sigmask; // Caller's signal mask 1.34 1.35 public: 1.36 @@ -70,28 +63,11 @@ 1.37 sigset_t caller_sigmask() const { return _caller_sigmask; } 1.38 void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } 1.39 1.40 -#ifdef _ALLBSD_SOURCE 1.41 -#ifdef __APPLE__ 1.42 - static size_t thread_id_size() { return sizeof(thread_t); } 1.43 - thread_t thread_id() const { 1.44 - return _thread_id; 1.45 - } 1.46 -#else 1.47 - static size_t thread_id_size() { return sizeof(pthread_t); } 1.48 - pthread_t thread_id() const { 1.49 - return _thread_id; 1.50 - } 1.51 -#endif 1.52 -#else 1.53 - static size_t thread_id_size() { return sizeof(pid_t); } 1.54 - pid_t thread_id() const { 1.55 - return _thread_id; 1.56 - } 1.57 -#endif 1.58 #ifndef PRODUCT 1.59 // Used for debugging, return a unique integer for each thread. 1.60 intptr_t thread_identifier() const { return (intptr_t)_pthread_id; } 1.61 #endif 1.62 + 1.63 #ifdef ASSERT 1.64 // We expect no reposition failures so kill vm if we get one. 1.65 // 1.66 @@ -99,21 +75,7 @@ 1.67 return false; 1.68 } 1.69 #endif // ASSERT 1.70 -#ifdef _ALLBSD_SOURCE 1.71 -#ifdef __APPLE__ 1.72 - void set_thread_id(thread_t id) { 1.73 - _thread_id = id; 1.74 - } 1.75 -#else 1.76 - void set_thread_id(pthread_t id) { 1.77 - _thread_id = id; 1.78 - } 1.79 -#endif 1.80 -#else 1.81 - void set_thread_id(pid_t id) { 1.82 - _thread_id = id; 1.83 - } 1.84 -#endif 1.85 + 1.86 pthread_t pthread_id() const { 1.87 return _pthread_id; 1.88 }