I didn't realize that _numActive++ should be synchronized, I thought the ++ operator was atomic.
I'll put these also in a synchronized block.
http://cvs.apache.org/viewcvs/jakarta-commons/pool/src/java/org/apache/commons/pool/impl/GenericObjectPool.java?rev=1.23&content-type=text/vnd.viewcvs-markup
How does this new version looks?
Dirk
John McNally wrote:
My quick read of this change is not favorable. It looks like changes to
an unsynchronized list have been moved outside any synchronization. Also integer math like numActive++ outside a synchronization block has
got me into problems in the past. A test with two threads using i++ and
i-- ran quite some time (couple hours) on a single processor box, but
did eventually fail. Then the test was run on a dual processor box, it
failed pretty much immediately, repeatedly.
I'm -1 on this change.
john mcnally
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]