You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/04/06 19:34:13 UTC

Lock class now works!

I ran into problems with the pools in Cocoon due to intermittent
race conditions causing an IndexOutOfBoundsException when threads
tried to simultaneously release pooled objects.  The culprit was
the Lock class was not Locking, or releasing locks.

I had to change the way Lock functioned, so now you need one
Lock object for each resource you want to protect.  The (very
simple) API is this:

Lock {
    void lock()
    void unlock()
}

I can add in the isLocked() function easily, but I am not sure
what good that will do.  The Lock object will now block a thread
indefinitely until the Lock is released.

Due to these improvements, Lock's performance is MUCH quicker
than before.

This will affect some people, I don't know who was a user of the
class, so I appreciate any of your comments.

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org