Lock objects work very much like the implicit locks used by synchronized code.
锁对象的工作原理和通过同步方法严格实现的锁一样。
The biggest advantage of lock objects over implicit locks is their ability to back out of an attempt to acquire a lock.
锁对象比严格的锁最大的优势是他们能够从获得一个锁返回。
The Lock classes are just ordinary classes, and the JVM does not (yet) have any knowledge of which Lock objects are owned by specific threads.
Lock 类只是普通的类,JVM 不知道具体哪个线程拥有 Lock 对象。
应用推荐