Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不明白为什么当队列不为空时,应该有任何块可以从中获取?
顺便提一句。该报价来自Queue doc。
这意味着不能保证在empty对另一个线程的调用和下一次调用之间get可能还没有从队列中拉出一个元素来清空它。因此下一次调用get可以阻塞。
empty
get