Mercurial > hg > truffle
changeset 11091:a55aa67bce1a
Merge
author | zgu |
---|---|
date | Thu, 04 Jul 2013 04:03:28 -0700 |
parents | 5f7a4367c787 (diff) f323bbb0e6c1 (current diff) |
children | 59b052799158 |
files | |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 } }