comparison src/os/bsd/vm/os_bsd.cpp @ 8675:63e54c37ac64

8008959: Fix non-PCH build on Linux, Windows and MacOS X Summary: Fix the build without precompiled headers by either including the missing ".inline.hpp" files into the appropriate files or by turning inline-functions declared in header files into ordinary functions in ".cpp" files. Reviewed-by: coleenp, stefank, dholmes
author simonis
date Wed, 27 Feb 2013 09:40:30 +0100
parents 5cd2fac2ae70
children bdb602473679 6b803ba47588
comparison
equal deleted inserted replaced
8105:94478a033036 8675:63e54c37ac64
2693 Thread* thread = Thread::current(); 2693 Thread* thread = Thread::current();
2694 OSThread* osthread = thread->osthread(); 2694 OSThread* osthread = thread->osthread();
2695 assert(thread->is_VM_thread(), "Must be VMThread"); 2695 assert(thread->is_VM_thread(), "Must be VMThread");
2696 // read current suspend action 2696 // read current suspend action
2697 int action = osthread->sr.suspend_action(); 2697 int action = osthread->sr.suspend_action();
2698 if (action == SR_SUSPEND) { 2698 if (action == os::Bsd::SuspendResume::SR_SUSPEND) {
2699 suspend_save_context(osthread, siginfo, context); 2699 suspend_save_context(osthread, siginfo, context);
2700 2700
2701 // Notify the suspend action is about to be completed. do_suspend() 2701 // Notify the suspend action is about to be completed. do_suspend()
2702 // waits until SR_SUSPENDED is set and then returns. We will wait 2702 // waits until SR_SUSPENDED is set and then returns. We will wait
2703 // here for a resume signal and that completes the suspend-other 2703 // here for a resume signal and that completes the suspend-other
2715 2715
2716 // wait here until we are resumed 2716 // wait here until we are resumed
2717 do { 2717 do {
2718 sigsuspend(&suspend_set); 2718 sigsuspend(&suspend_set);
2719 // ignore all returns until we get a resume signal 2719 // ignore all returns until we get a resume signal
2720 } while (osthread->sr.suspend_action() != SR_CONTINUE); 2720 } while (osthread->sr.suspend_action() != os::Bsd::SuspendResume::SR_CONTINUE);
2721 2721
2722 resume_clear_context(osthread); 2722 resume_clear_context(osthread);
2723 2723
2724 } else { 2724 } else {
2725 assert(action == SR_CONTINUE, "unexpected sr action"); 2725 assert(action == os::Bsd::SuspendResume::SR_CONTINUE, "unexpected sr action");
2726 // nothing special to do - just leave the handler 2726 // nothing special to do - just leave the handler
2727 } 2727 }
2728 2728
2729 errno = old_errno; 2729 errno = old_errno;
2730 } 2730 }
2774 2774
2775 // returns true on success and false on error - really an error is fatal 2775 // returns true on success and false on error - really an error is fatal
2776 // but this seems the normal response to library errors 2776 // but this seems the normal response to library errors
2777 static bool do_suspend(OSThread* osthread) { 2777 static bool do_suspend(OSThread* osthread) {
2778 // mark as suspended and send signal 2778 // mark as suspended and send signal
2779 osthread->sr.set_suspend_action(SR_SUSPEND); 2779 osthread->sr.set_suspend_action(os::Bsd::SuspendResume::SR_SUSPEND);
2780 int status = pthread_kill(osthread->pthread_id(), SR_signum); 2780 int status = pthread_kill(osthread->pthread_id(), SR_signum);
2781 assert_status(status == 0, status, "pthread_kill"); 2781 assert_status(status == 0, status, "pthread_kill");
2782 2782
2783 // check status and wait until notified of suspension 2783 // check status and wait until notified of suspension
2784 if (status == 0) { 2784 if (status == 0) {
2785 for (int i = 0; !osthread->sr.is_suspended(); i++) { 2785 for (int i = 0; !osthread->sr.is_suspended(); i++) {
2786 os::yield_all(i); 2786 os::yield_all(i);
2787 } 2787 }
2788 osthread->sr.set_suspend_action(SR_NONE); 2788 osthread->sr.set_suspend_action(os::Bsd::SuspendResume::SR_NONE);
2789 return true; 2789 return true;
2790 } 2790 }
2791 else { 2791 else {
2792 osthread->sr.set_suspend_action(SR_NONE); 2792 osthread->sr.set_suspend_action(os::Bsd::SuspendResume::SR_NONE);
2793 return false; 2793 return false;
2794 } 2794 }
2795 } 2795 }
2796 2796
2797 static void do_resume(OSThread* osthread) { 2797 static void do_resume(OSThread* osthread) {
2798 assert(osthread->sr.is_suspended(), "thread should be suspended"); 2798 assert(osthread->sr.is_suspended(), "thread should be suspended");
2799 osthread->sr.set_suspend_action(SR_CONTINUE); 2799 osthread->sr.set_suspend_action(os::Bsd::SuspendResume::SR_CONTINUE);
2800 2800
2801 int status = pthread_kill(osthread->pthread_id(), SR_signum); 2801 int status = pthread_kill(osthread->pthread_id(), SR_signum);
2802 assert_status(status == 0, status, "pthread_kill"); 2802 assert_status(status == 0, status, "pthread_kill");
2803 // check status and wait unit notified of resumption 2803 // check status and wait unit notified of resumption
2804 if (status == 0) { 2804 if (status == 0) {
2805 for (int i = 0; osthread->sr.is_suspended(); i++) { 2805 for (int i = 0; osthread->sr.is_suspended(); i++) {
2806 os::yield_all(i); 2806 os::yield_all(i);
2807 } 2807 }
2808 } 2808 }
2809 osthread->sr.set_suspend_action(SR_NONE); 2809 osthread->sr.set_suspend_action(os::Bsd::SuspendResume::SR_NONE);
2810 } 2810 }
2811 2811
2812 //////////////////////////////////////////////////////////////////////////////// 2812 ////////////////////////////////////////////////////////////////////////////////
2813 // interrupt support 2813 // interrupt support
2814 2814