Replies: 1 comment
-
有很多地方都会释放锁,你说的一直循环不释放锁我不明白,你贴下代码解释下? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
如果
retrieveWorker
方法在阻塞且worker满了的状态下进了retry
中,没有获取到worker就会一直在retry
中循环而无法调用lock.Unlock
释放锁,是这样吗?但是
revertWorker
中需要锁才能进入insert
然后添加worker,于是就一直卡在lock.Lock()
上。除非有一个别的地方在不调用
p.lock.Lock()
的情况下直接调用p.lock.Unlock()
强行释放。我不知道我说的对不对,恳请各位大佬指点以下,我这里一直不太能看懂。
Beta Was this translation helpful? Give feedback.
All reactions