多线程 - 为何 python condition acquire 会阻塞线程?
PHP中文网
PHP中文网 2017-04-18 09:37:29
0
2
356
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
大家讲道理

Queue comes with its own lock

If you use another lock, it is easy to cause a deadlock~

Also, you need to change sleep to cond.wait(), so that notify() will work~

洪涛

After reading the document for a long time, the RLock written above only has the reentrant feature in a thread

Reference: https://docs.python.org/2/lib...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!