# HG changeset patch # User zgu # Date 1372935808 25200 # Node ID a55aa67bce1a931ffc232aeba7f911a26bf67c91 # Parent 5f7a4367c78702f6e3917706bcac215d41ad96f1# Parent f323bbb0e6c1208911c582fba71ad16f890c6108 Merge diff -r f323bbb0e6c1 -r a55aa67bce1a src/share/vm/services/memTracker.hpp --- a/src/share/vm/services/memTracker.hpp Wed Jul 03 13:45:39 2013 -0400 +++ b/src/share/vm/services/memTracker.hpp Thu Jul 04 04:03:28 2013 -0700 @@ -470,7 +470,21 @@ static void check_NMT_load(Thread* thr) { assert(thr != NULL, "Sanity check"); 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(); +#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 } }