GOP and GKOP both use the following idiom in several places to check
to see if an instance has been allocated to a thread:
synchronized (this) {
// Make sure allocate hasn't already assigned an object
// in a different thread or permitted a new object to be created
if (latch.getPair() == null && !latch.mayCreate()) {
_allocationQueue.remove(latch);
} else {
break;
}
}
Couldn't the check on latch state be synched just on the latch (and
then acquire the pool lock only if there is something to remove)?
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]