468 } |
468 } |
469 |
469 |
470 static void check_NMT_load(Thread* thr) { |
470 static void check_NMT_load(Thread* thr) { |
471 assert(thr != NULL, "Sanity check"); |
471 assert(thr != NULL, "Sanity check"); |
472 if (_slowdown_calling_thread && thr != _worker_thread) { |
472 if (_slowdown_calling_thread && thr != _worker_thread) { |
|
473 #ifdef _WINDOWS |
|
474 // On Windows, os::NakedYield() does not work as well |
|
475 // as os::yield_all() |
473 os::yield_all(); |
476 os::yield_all(); |
|
477 #else |
|
478 // On Solaris, os::yield_all() depends on os::sleep() |
|
479 // which requires JavaTherad in _thread_in_vm state. |
|
480 // Transits thread to _thread_in_vm state can be dangerous |
|
481 // if caller holds lock, as it may deadlock with Threads_lock. |
|
482 // So use NaKedYield instead. |
|
483 // |
|
484 // Linux and BSD, NakedYield() and yield_all() implementations |
|
485 // are the same. |
|
486 os::NakedYield(); |
|
487 #endif |
474 } |
488 } |
475 } |
489 } |
476 |
490 |
477 static void inc_pending_op_count() { |
491 static void inc_pending_op_count() { |
478 Atomic::inc(&_pending_op_count); |
492 Atomic::inc(&_pending_op_count); |