Just to be sure, can experts confirm that
java.util.concurrent.locks.Lock
and Doug Lea's original Sync
are basically the same thing but with different names.
- acquire vs lock
- release vs unlock
Thanks.
Just to be sure, can experts confirm that
java.util.concurrent.locks.Lock
and Doug Lea's original Sync
are basically the same thing but with different names.
Thanks.
For what it is worth, the source code for java.util.concurrent.locks.Lock lists Doug Lea as its author. Same goes for many other files in that package.
/*
* This file is available under and governed by the GNU General Public
* License version 2 only, as published by the Free Software Foundation.
* However, the following notice accompanied the original version of this
* file:
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
* http://creativecommons.org/licenses/publicdomain
*/
A ReentrantLock which implements Lock wraps a class called Sync. All were written by Doug Lea. I suggest you try to use the libraries in Java.