< prev index next >

src/hotspot/os/linux/os_linux.cpp

Print this page




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


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




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


< prev index next >