ReentrantLock
2020-09-17 14:16:51 0 举报
java的AQS锁
作者其他创作
大纲/内容
Node thread = nullpre = nullnext = t2节点
t5take操作
exclusiveOwnerThread=t1
tail
waitStatus = SIGNAL
int state = 1
t1
firstWaiter
lastWaiter
t2
双向
ReentrantLock
Condition notEmpty
t4take操作
Node thread = nullpre = t2节点next = null
t6take操作
AbstractQueuedSynchronizer
notEmpty
notFull
Node thread = t2pre = headnext = t3节点
Node thread = t5pre = 前节点next = nullwaitStatus=0nextWaiter = null
head
Node thread = t3pre = t2节点next = null
thread = t6waitStatus=CONDITION(-2)nextWaiter = null
thread = t3waitStatus=CONDITION(-2)nextWaiter = null
t3put操作
Object[] items
单向
t3
thread = t5waitStatus=CONDITION(-2)nextWaiter = t6节点
t1 put 操作
thread = t2waitStatus=CONDITION(-2)nextWaiter = t3节点
Condition notFull
Node thread = nullpre = t1节点next = t3
ArrayBlockingQueue<E> . 假设容量为1
Node thread = t2pre = 前节点next = nullwaitStatus=0nextWaiter = null
t2put操作
收藏
0 条评论
下一页