ReentrantLock.Condition
2021-05-13 15:56:00 1 举报
并发编程之Condition
作者其他创作
大纲/内容
state=1exclusiveOwnerThread=ThreadA
AQS同步队列
Node
condition.signal()
thread=nullwaitStatus=0
thread=ThreadCwaitStatus=0
condition.await()
ThreadB
构建
Condition队列
竞争
state=0exclusiveOwnerThread=null
lock.lock()临界区
ThreadA
next
prev
thread=nullwaitStatus=SIGNAL
head
Reentrant.Condition
线程B执行condition
某个线程
transferForSignal()将Condition队列中的结点转移到AQS同步队列
state=1exclusiveOwnerThread=ThreadB
ThreadC
firstWaiter
lastWaiter
thread=ThreadAwaitStatus=CONDITION
线程A执行condition
tail
thread=ThreadBwaitStatus=CONDITION
执行
0 条评论
回复 删除
下一页