677 // initialize floating point control register
678 os::Linux::init_thread_fpu_state();
679
680 // handshaking with parent thread
681 {
682 MutexLockerEx ml(sync, Mutex::_no_safepoint_check_flag);
683
684 // notify parent thread
685 osthread->set_state(INITIALIZED);
686 sync->notify_all();
687
688 // wait until os::start_thread()
689 while (osthread->get_state() == INITIALIZED) {
690 sync->wait(Mutex::_no_safepoint_check_flag);
691 }
692 }
693
694 // call one more level start routine
695 thread->run();
696
697 log_info(os, thread)("Thread finished (tid " UINTX_FORMAT ", pthread id " UINTX_FORMAT ").",
698 os::current_thread_id(), (uintx) pthread_self());
699
700 return 0;
701 }
702
703 bool os::create_thread(Thread* thread, ThreadType thr_type,
704 size_t stack_size) {
705 assert(thread->osthread() == NULL, "caller responsible");
706
707 // Allocate the OSThread object
708 OSThread* osthread = new OSThread(NULL, NULL);
709 if (osthread == NULL) {
710 return false;
711 }
712
713 // set the correct thread state
714 osthread->set_thread_type(thr_type);
715
716 // Initial state is ALLOCATED but not INITIALIZED
717 osthread->set_state(ALLOCATED);
|
677 // initialize floating point control register
678 os::Linux::init_thread_fpu_state();
679
680 // handshaking with parent thread
681 {
682 MutexLockerEx ml(sync, Mutex::_no_safepoint_check_flag);
683
684 // notify parent thread
685 osthread->set_state(INITIALIZED);
686 sync->notify_all();
687
688 // wait until os::start_thread()
689 while (osthread->get_state() == INITIALIZED) {
690 sync->wait(Mutex::_no_safepoint_check_flag);
691 }
692 }
693
694 // call one more level start routine
695 thread->run();
696
697 log_info(os, thread)("Thread finished (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").",
698 os::current_thread_id(), (uintx) pthread_self());
699
700 return 0;
701 }
702
703 bool os::create_thread(Thread* thread, ThreadType thr_type,
704 size_t stack_size) {
705 assert(thread->osthread() == NULL, "caller responsible");
706
707 // Allocate the OSThread object
708 OSThread* osthread = new OSThread(NULL, NULL);
709 if (osthread == NULL) {
710 return false;
711 }
712
713 // set the correct thread state
714 osthread->set_thread_type(thr_type);
715
716 // Initial state is ALLOCATED but not INITIALIZED
717 osthread->set_state(ALLOCATED);
|