认证高级PHP讲师
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...
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...