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: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to