February 2014
Beginner
1248 pages
62h 25m
English
• The Lock and Condition interfaces (p. 1002) give programmers more precise control over thread synchronization, but are more complicated to use.
• Any object can contain a reference to an object that implements the Lock interface (of package java.util.concurrent.locks). A thread calls a Lock’s lock method (p. 1002) to acquire the lock. Once a Lock has been obtained by one thread, the Lock will not allow another thread to obtain it until the first thread releases it (by calling the Lock’s unlock method; p. 1002).
• If several threads are trying to call method lock on the same Lock object at the same time, only one thread can obtain the lock—the others are ...
Read now
Unlock full access