mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 12:34:32 +02:00
8016074: NMT: assertion failed: assert(thread->thread_state() == from) failed: coming from wrong thread state
Uses os::NakedYield() on Solaris instead of os::yield_all() Reviewed-by: acorn, coleenp, hseigel
This commit is contained in:
parent
4ecee47075
commit
3e8c767620
1 changed files with 14 additions and 0 deletions
|
@ -470,7 +470,21 @@ class MemTracker : AllStatic {
|
||||||
static void check_NMT_load(Thread* thr) {
|
static void check_NMT_load(Thread* thr) {
|
||||||
assert(thr != NULL, "Sanity check");
|
assert(thr != NULL, "Sanity check");
|
||||||
if (_slowdown_calling_thread && thr != _worker_thread) {
|
if (_slowdown_calling_thread && thr != _worker_thread) {
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
// On Windows, os::NakedYield() does not work as well
|
||||||
|
// as os::yield_all()
|
||||||
os::yield_all();
|
os::yield_all();
|
||||||
|
#else
|
||||||
|
// On Solaris, os::yield_all() depends on os::sleep()
|
||||||
|
// which requires JavaTherad in _thread_in_vm state.
|
||||||
|
// Transits thread to _thread_in_vm state can be dangerous
|
||||||
|
// if caller holds lock, as it may deadlock with Threads_lock.
|
||||||
|
// So use NaKedYield instead.
|
||||||
|
//
|
||||||
|
// Linux and BSD, NakedYield() and yield_all() implementations
|
||||||
|
// are the same.
|
||||||
|
os::NakedYield();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue