Mercurial > hg > graal-jvmci-8
comparison src/share/vm/services/memTracker.hpp @ 11090:5f7a4367c787
8016074: NMT: assertion failed: assert(thread->thread_state() == from) failed: coming from wrong thread state
Summary: Uses os::NakedYield() on Solaris instead of os::yield_all()
Reviewed-by: acorn, coleenp, hseigel
author | zgu |
---|---|
date | Thu, 04 Jul 2013 06:24:08 -0400 |
parents | 1f4355cee9a2 |
children | 4c84d351cca9 |
comparison
equal
deleted
inserted
replaced
11065:cedf20e2a655 | 11090:5f7a4367c787 |
---|---|
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); |