8028280: ParkEvent leak when running modified runThese which only loads classes

Use spin lock to manage ParkEvent and PlatformEvent free lists.

Reviewed-by: dholmes, fparain
This commit is contained in:
David Simms 2014-01-24 09:28:47 +01:00
parent 90a44b778d
commit edb5dd324e
7 changed files with 95 additions and 112 deletions

View file

@ -4446,9 +4446,7 @@ void Thread::SpinAcquire (volatile int * adr, const char * LockName) {
++ctr ;
if ((ctr & 0xFFF) == 0 || !os::is_MP()) {
if (Yields > 5) {
// Consider using a simple NakedSleep() instead.
// Then SpinAcquire could be called by non-JVM threads
Thread::current()->_ParkEvent->park(1) ;
os::naked_short_sleep(1);
} else {
os::NakedYield() ;
++Yields ;