为什么当running为0的时候,需要唤醒所有的goroutine? #251
Answered
by
panjf2000
lingfengChen03
asked this question in
Q&A
-
作者您好,我不太理解为什么第一个条件p.Running() == 0为什么调用p.cond.Broadcast()? |
Beta Was this translation helpful? Give feedback.
Answered by
panjf2000
Sep 6, 2022
Replies: 1 comment
-
仔细看 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
panjf2000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
仔细看
retrieveWorker()
的代码,全部唤醒后可以有不止一个阻塞的调用者可以直接新开 worker 直接执行任务。