1.1 --- a/src/share/vm/services/memTracker.hpp Tue Jul 02 16:54:24 2013 +0200 1.2 +++ b/src/share/vm/services/memTracker.hpp Thu Jul 04 06:24:08 2013 -0400 1.3 @@ -470,7 +470,21 @@ 1.4 static void check_NMT_load(Thread* thr) { 1.5 assert(thr != NULL, "Sanity check"); 1.6 if (_slowdown_calling_thread && thr != _worker_thread) { 1.7 +#ifdef _WINDOWS 1.8 + // On Windows, os::NakedYield() does not work as well 1.9 + // as os::yield_all() 1.10 os::yield_all(); 1.11 +#else 1.12 + // On Solaris, os::yield_all() depends on os::sleep() 1.13 + // which requires JavaTherad in _thread_in_vm state. 1.14 + // Transits thread to _thread_in_vm state can be dangerous 1.15 + // if caller holds lock, as it may deadlock with Threads_lock. 1.16 + // So use NaKedYield instead. 1.17 + // 1.18 + // Linux and BSD, NakedYield() and yield_all() implementations 1.19 + // are the same. 1.20 + os::NakedYield(); 1.21 +#endif 1.22 } 1.23 } 1.24