[RFC][icedtea-web]: possible race condition.
Denis Lila
dlila at redhat.com
Mon Mar 7 15:55:57 PST 2011
This is better. It fixes a few issues I discussed with
Omair on irc.
Regards,
Denis.
----- Original Message -----
> Hi.
>
> This patch fixes what I think is a concurrency problem.
> We do synchronized(requestIdentityCounter) in order to
> prevent race conditions, but that doesn't work because
> "synchronized" locks the object, not the reference. As
> soon as we write something to the reference (i.e. the =0L
> or the ++), we allow other threads to enter the synchronized
> region while we are still in it (because we don't have
> the lock of the new object that the reference points to).
> This could result in 2 different requests having the same
> identifier, which would be very bad.
>
> The patch also fixes the use of "==" to compare 2 Long
> objects.
>
> Ok to push?
>
> Thank you,
> Denis.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: synchronization.patch
Type: text/x-patch
Size: 1553 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20110307/23a07cea/synchronization.patch
More information about the distro-pkg-dev
mailing list