ReentrantLock
公平锁<br>
new ReentrantLock(true)
可重入
rl.lock 几次,rl.unlock()几次<br>
等待时限<br>
rl.tryLock(5, TimeUnit.SECONDS)
中断响应<br>
try: rl.lockInterruptibly(), rl.isHeldByCurrentThread()<br>
实现<br>
原子状态:CAS
等待队列
park(), unpark()<br>
原子状态:CAS
等待队列
park(), unpark()<br>
Condition
c.await()
c.awaitUninterruptibly(0
c.signal()<br>
c.signalAll()
c = rl.newCondition()<br>
Semaphore
new Semaphore(int permites, boolean fair<br>
s.acquire()
s.acquireUninterruptibly()
s.tryAcquire()
s.tryAcquire(long timeout, TimeUnit unit)
s.release()