< prev index next >

src/hotspot/os/linux/os_linux.cpp

Print this page




 688   // initialize signal mask for this thread
 689   os::Linux::hotspot_sigmask(thread);
 690 
 691   // initialize floating point control register
 692   os::Linux::init_thread_fpu_state();
 693 
 694   // handshaking with parent thread
 695   {
 696     MutexLockerEx ml(sync, Mutex::_no_safepoint_check_flag);
 697 
 698     // notify parent thread
 699     osthread->set_state(INITIALIZED);
 700     sync->notify_all();
 701 
 702     // wait until os::start_thread()
 703     while (osthread->get_state() == INITIALIZED) {
 704       sync->wait(Mutex::_no_safepoint_check_flag);
 705     }
 706   }
 707 


 708   // call one more level start routine
 709   thread->call_run();
 710 
 711   // Note: at this point the thread object may already have deleted itself.
 712   // Prevent dereferencing it from here on out.
 713   thread = NULL;
 714 
 715   log_info(os, thread)("Thread finished (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").",
 716     os::current_thread_id(), (uintx) pthread_self());
 717 
 718   return 0;
 719 }
 720 
 721 bool os::create_thread(Thread* thread, ThreadType thr_type,
 722                        size_t req_stack_size) {
 723   assert(thread->osthread() == NULL, "caller responsible");
 724 
 725   // Allocate the OSThread object
 726   OSThread* osthread = new OSThread(NULL, NULL);
 727   if (osthread == NULL) {




 688   // initialize signal mask for this thread
 689   os::Linux::hotspot_sigmask(thread);
 690 
 691   // initialize floating point control register
 692   os::Linux::init_thread_fpu_state();
 693 
 694   // handshaking with parent thread
 695   {
 696     MutexLockerEx ml(sync, Mutex::_no_safepoint_check_flag);
 697 
 698     // notify parent thread
 699     osthread->set_state(INITIALIZED);
 700     sync->notify_all();
 701 
 702     // wait until os::start_thread()
 703     while (osthread->get_state() == INITIALIZED) {
 704       sync->wait(Mutex::_no_safepoint_check_flag);
 705     }
 706   }
 707 
 708   assert(osthread->pthread_id() != 0, "pthread_id was not set as expected");
 709 
 710   // call one more level start routine
 711   thread->call_run();
 712 
 713   // Note: at this point the thread object may already have deleted itself.
 714   // Prevent dereferencing it from here on out.
 715   thread = NULL;
 716 
 717   log_info(os, thread)("Thread finished (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").",
 718     os::current_thread_id(), (uintx) pthread_self());
 719 
 720   return 0;
 721 }
 722 
 723 bool os::create_thread(Thread* thread, ThreadType thr_type,
 724                        size_t req_stack_size) {
 725   assert(thread->osthread() == NULL, "caller responsible");
 726 
 727   // Allocate the OSThread object
 728   OSThread* osthread = new OSThread(NULL, NULL);
 729   if (osthread == NULL) {


< prev index next >