mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 06:14:49 +02:00
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:
parent
90a44b778d
commit
edb5dd324e
7 changed files with 95 additions and 112 deletions
|
@ -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 ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue