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