465 static void free_thread(OSThread* osthread); |
465 static void free_thread(OSThread* osthread); |
466 |
466 |
467 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit |
467 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit |
468 static intx current_thread_id(); |
468 static intx current_thread_id(); |
469 static int current_process_id(); |
469 static int current_process_id(); |
470 static int sleep(Thread* thread, jlong ms, bool interruptable); |
470 // Implementation of java.lang.Thread.sleep for JavaThreads |
471 // Short standalone OS sleep suitable for slow path spin loop. |
471 static int sleep(JavaThread* thread, jlong ms); |
472 // Ignores Thread.interrupt() (so keep it short). |
472 // Short standalone OS sleep routines suitable for slow path spin loop. |
473 // ms = 0, will sleep for the least amount of time allowed by the OS. |
473 // Ignores safepoints/suspension/Thread.interrupt() (so keep it short). |
|
474 // ms/ns = 0, will sleep for the least amount of time allowed by the OS. |
|
475 // Maximum sleep time is just under 1 second. |
474 static void naked_short_sleep(jlong ms); |
476 static void naked_short_sleep(jlong ms); |
475 static void naked_short_nanosleep(jlong ns); |
477 static void naked_short_nanosleep(jlong ns); |
476 static void infinite_sleep(); // never returns, use with CAUTION |
478 // Longer standalone OS sleep routine - a convenience wrapper around |
|
479 // multiple calls to naked_short_sleep. Only for use by non-JavaThreads. |
|
480 static void naked_sleep(jlong millis); |
|
481 // Never returns, use with CAUTION |
|
482 static void infinite_sleep(); |
477 static void naked_yield () ; |
483 static void naked_yield () ; |
478 static OSReturn set_priority(Thread* thread, ThreadPriority priority); |
484 static OSReturn set_priority(Thread* thread, ThreadPriority priority); |
479 static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority); |
485 static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority); |
480 |
486 |
481 static void interrupt(Thread* thread); |
487 static void interrupt(Thread* thread); |