equal
deleted
inserted
replaced
447 // TODO: restrict the aggregate number of spinners. |
447 // TODO: restrict the aggregate number of spinners. |
448 |
448 |
449 ++its; |
449 ++its; |
450 if (its > 10000 || !os::is_MP()) { |
450 if (its > 10000 || !os::is_MP()) { |
451 if (its & 1) { |
451 if (its & 1) { |
452 os::NakedYield(); |
452 os::naked_yield(); |
453 TEVENT(Inflate: INFLATING - yield); |
453 TEVENT(Inflate: INFLATING - yield); |
454 } else { |
454 } else { |
455 // Note that the following code attenuates the livelock problem but is not |
455 // Note that the following code attenuates the livelock problem but is not |
456 // a complete remedy. A more complete solution would require that the inflating |
456 // a complete remedy. A more complete solution would require that the inflating |
457 // thread hold the associated inflation lock. The following code simply restricts |
457 // thread hold the associated inflation lock. The following code simply restricts |
477 // so we periodically call Self->_ParkEvent->park(1). |
477 // so we periodically call Self->_ParkEvent->park(1). |
478 // We use a mixed spin/yield/block mechanism. |
478 // We use a mixed spin/yield/block mechanism. |
479 if ((YieldThenBlock++) >= 16) { |
479 if ((YieldThenBlock++) >= 16) { |
480 Thread::current()->_ParkEvent->park(1); |
480 Thread::current()->_ParkEvent->park(1); |
481 } else { |
481 } else { |
482 os::NakedYield(); |
482 os::naked_yield(); |
483 } |
483 } |
484 } |
484 } |
485 Thread::muxRelease(InflationLocks + ix); |
485 Thread::muxRelease(InflationLocks + ix); |
486 TEVENT(Inflate: INFLATING - yield/park); |
486 TEVENT(Inflate: INFLATING - yield/park); |
487 } |
487 } |