--- old/src/os/bsd/vm/os_bsd.cpp 2012-02-15 10:54:10.000000000 +0100 +++ new/src/os/bsd/vm/os_bsd.cpp 2012-02-15 10:54:10.000000000 +0100 @@ -979,8 +979,8 @@ } #ifdef _ALLBSD_SOURCE - // thread_id is pthread_id on BSD - osthread->set_thread_id(::pthread_self()); + // thread_id is mach thread on BSD + osthread->set_thread_id(::mach_thread_self()); #else // thread_id is kernel thread id (similar to Solaris LWP id) osthread->set_thread_id(os::Bsd::gettid()); @@ -1171,7 +1171,7 @@ // Store pthread info into the OSThread #ifdef _ALLBSD_SOURCE - osthread->set_thread_id(::pthread_self()); + osthread->set_thread_id(::mach_thread_self()); #else osthread->set_thread_id(os::Bsd::gettid()); #endif @@ -1788,7 +1788,7 @@ return n; } -intx os::current_thread_id() { return (intx)pthread_self(); } +intx os::current_thread_id() { return (intx)::mach_thread_self(); } int os::current_process_id() { // Under the old bsd thread library, bsd gives each thread @@ -5133,9 +5133,9 @@ struct thread_basic_info tinfo; mach_msg_type_number_t tcount = THREAD_INFO_MAX; kern_return_t kr; - mach_port_t mach_thread; + thread_t mach_thread; - mach_thread = pthread_mach_thread_np(thread->osthread()->thread_id()); + mach_thread = thread->osthread()->thread_id(); kr = thread_info(mach_thread, THREAD_BASIC_INFO, (thread_info_t)&tinfo, &tcount); if (kr != KERN_SUCCESS) return -1;