Lock
In JDK1.5, it provides us one different solution to control the thread concurrency. We can use the Lock API to achieve the exactly the same goal as synchronized key word.
In fact, Lock is one Interface, it has several implementations, the most famous is ReentrantLock.
Baic Concerpt:
1:
浙公网安备 33010602011771号