428 |
428 |
429 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit |
429 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit |
430 static intx current_thread_id(); |
430 static intx current_thread_id(); |
431 static int current_process_id(); |
431 static int current_process_id(); |
432 static int sleep(Thread* thread, jlong ms, bool interruptable); |
432 static int sleep(Thread* thread, jlong ms, bool interruptable); |
433 static int naked_sleep(); |
433 // Short standalone OS sleep suitable for slow path spin loop. |
|
434 // Ignores Thread.interrupt() (so keep it short). |
|
435 // ms = 0, will sleep for the least amount of time allowed by the OS. |
|
436 static void naked_short_sleep(jlong ms); |
434 static void infinite_sleep(); // never returns, use with CAUTION |
437 static void infinite_sleep(); // never returns, use with CAUTION |
435 static void yield(); // Yields to all threads with same priority |
438 static void yield(); // Yields to all threads with same priority |
436 enum YieldResult { |
439 enum YieldResult { |
437 YIELD_SWITCHED = 1, // caller descheduled, other ready threads exist & ran |
440 YIELD_SWITCHED = 1, // caller descheduled, other ready threads exist & ran |
438 YIELD_NONEREADY = 0, // No other runnable/ready threads. |
441 YIELD_NONEREADY = 0, // No other runnable/ready threads. |