[concurrency-interest] ConcurrentHashMap computeIfAbsent

Peter Levart peter.levart at gmail.com
Sun Dec 21 14:55:58 EST 2014


On 12/21/2014 08:33 PM, Peter Levart wrote:
> Here's to illustrate what I mean:
>
> http://cr.openjdk.java.net/~plevart/misc/CHM.nonreentrantLocks/webrev.01/
>
> Changes I did are purely mechanical.


Sorry, changes I did to code at last moment were not correct. This is 
what I had before and was correct:

http://cr.openjdk.java.net/~plevart/misc/CHM.nonreentrantLocks/webrev.02/

The node.checkNotEntered() must be called before synchronized block, 
since it contains a check for Thread.holdsLock(). node.enter() does not 
contain a check, so checkNotEntered() must be called before synchronized 
blocks that call-back user code too (where necessary).


Regards, Peter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20141221/61e2e14a/attachment.html>


More information about the Concurrency-interest mailing list