Hi,
Now I read the javadoc for object.wait:
"Note that the wait method, as it places the current thread into the
wait set for this object, unlocks only this object; any other objects on
which the current thread may be synchronized remain locked while the
thread waits. "
So it is a bug in jboss, not in the jdks :(
Sebastien
marc fleury wrote:
>
> <THIS IS CRAZY>
>
> So the new locking cache completely lock the server.
>
> I started by thinking "Simone..." and then we dug deeper and we found that
> the construct
>
> synchronized(objectA) {
>
> synchronized(objectB) {
> objectB.wait();
> }
> }
>
> doesnt' release the lock on objectA *at all*
> - jdk1.3 IBM/Windows, IBM/Linux, SUN/Windows
> work sometimes on
> - jdk1.3 SUN/LINUX, blackdown/linux
>
> crazy huh? It was supposed to be that all the locks acquired would be
> released but noooooo....
>
> So the construct in EntityInstanceCache with synchronized(mutex)
> synchronized(context) {}}
> doesn't work, bummer.
>
> There is a *bad* temporary fix introduced by sebastien where we release the
> lock somehow (by changing the do and synchronized in the code (I asked him
> to commit it).
>
> BUT CLEARLY THIS IS A BUG IN JDKs.... (right?)
>
> So now we need to work around it, the first thing that comes to mind is to
> remove the "mutex" thingy, since I don't think it is really necessary (or is
> it???) and just lock on the context since at least it seems that it does
> release locks on the object it has.
>
> ideas? (btw the test code is in jbosstest and is called "locktest"
>
> regards
>
> marc
>
> ________________
> Marc Fleury, PhD
> CTO, Telkel Inc.
> ________________