src/share/vm/runtime/os.hpp

Print this page




 436 
 437   // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit
 438   static intx current_thread_id();
 439   static int current_process_id();
 440   static int sleep(Thread* thread, jlong ms, bool interruptable);
 441   // Short standalone OS sleep suitable for slow path spin loop.
 442   // Ignores Thread.interrupt() (so keep it short).
 443   // ms = 0, will sleep for the least amount of time allowed by the OS.
 444   static void naked_short_sleep(jlong ms);
 445   static void infinite_sleep(); // never returns, use with CAUTION
 446   static void yield();        // Yields to all threads with same priority
 447   enum YieldResult {
 448     YIELD_SWITCHED = 1,         // caller descheduled, other ready threads exist & ran
 449     YIELD_NONEREADY = 0,        // No other runnable/ready threads.
 450                                 // platform-specific yield return immediately
 451     YIELD_UNKNOWN = -1          // Unknown: platform doesn't support _SWITCHED or _NONEREADY
 452     // YIELD_SWITCHED and YIELD_NONREADY imply the platform supports a "strong"
 453     // yield that can be used in lieu of blocking.
 454   } ;
 455   static YieldResult NakedYield () ;
 456   static void yield_all(); // Yields to all other threads including lower priority
 457                            // (for the default scheduling policy)
 458   static OSReturn set_priority(Thread* thread, ThreadPriority priority);
 459   static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority);
 460 
 461   static void interrupt(Thread* thread);
 462   static bool is_interrupted(Thread* thread, bool clear_interrupted);
 463 
 464   static int pd_self_suspend_thread(Thread* thread);
 465 
 466   static ExtendedPC fetch_frame_from_context(void* ucVoid, intptr_t** sp, intptr_t** fp);
 467   static frame      fetch_frame_from_context(void* ucVoid);
 468 
 469   static ExtendedPC get_thread_pc(Thread *thread);
 470   static void breakpoint();
 471 
 472   static address current_stack_pointer();
 473   static address current_stack_base();
 474   static size_t current_stack_size();
 475 
 476   static void verify_stack_alignment() PRODUCT_RETURN;
 477 




 436 
 437   // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit
 438   static intx current_thread_id();
 439   static int current_process_id();
 440   static int sleep(Thread* thread, jlong ms, bool interruptable);
 441   // Short standalone OS sleep suitable for slow path spin loop.
 442   // Ignores Thread.interrupt() (so keep it short).
 443   // ms = 0, will sleep for the least amount of time allowed by the OS.
 444   static void naked_short_sleep(jlong ms);
 445   static void infinite_sleep(); // never returns, use with CAUTION
 446   static void yield();        // Yields to all threads with same priority
 447   enum YieldResult {
 448     YIELD_SWITCHED = 1,         // caller descheduled, other ready threads exist & ran
 449     YIELD_NONEREADY = 0,        // No other runnable/ready threads.
 450                                 // platform-specific yield return immediately
 451     YIELD_UNKNOWN = -1          // Unknown: platform doesn't support _SWITCHED or _NONEREADY
 452     // YIELD_SWITCHED and YIELD_NONREADY imply the platform supports a "strong"
 453     // yield that can be used in lieu of blocking.
 454   } ;
 455   static YieldResult NakedYield () ;


 456   static OSReturn set_priority(Thread* thread, ThreadPriority priority);
 457   static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority);
 458 
 459   static void interrupt(Thread* thread);
 460   static bool is_interrupted(Thread* thread, bool clear_interrupted);
 461 
 462   static int pd_self_suspend_thread(Thread* thread);
 463 
 464   static ExtendedPC fetch_frame_from_context(void* ucVoid, intptr_t** sp, intptr_t** fp);
 465   static frame      fetch_frame_from_context(void* ucVoid);
 466 
 467   static ExtendedPC get_thread_pc(Thread *thread);
 468   static void breakpoint();
 469 
 470   static address current_stack_pointer();
 471   static address current_stack_base();
 472   static size_t current_stack_size();
 473 
 474   static void verify_stack_alignment() PRODUCT_RETURN;
 475