Files
deb-python-eventlet/tests/isolated
Quan Tian f72cc96a70 patcher: set locked RLocks' owner only when patching existing locks
For Python 2, patching existing locks replaces RLock._RLock__owner with current
thread ID no matter the old lock is locked or not and thus an unlocked RLock
would have a non None owner (e.g. <_RLock owner=140106584489808 count=0>).
Then if we acquire the RLock in the same thread, the method RLock.acquire would
not invoke the _RLock__block.acquire() since it treats this is a recursive
acquire by checking current thread ID. And then the following RLock.release
would invoke the _RLock__block.release method resulting in the counter of
Semaphore being improved to 2.

There should be only two states being expected for RLock:
1. owner != None and count > 0
2. owner == None and count == 0

This patch fixs it by only setting locked RLocks' owner during patching.
2017-05-10 19:32:43 -07:00
..
2016-02-12 20:42:03 +05:00
2016-02-12 20:42:03 +05:00
2016-02-12 20:42:03 +05:00
2016-02-12 20:42:03 +05:00
2017-01-05 09:06:15 +03:00
2016-02-12 20:42:03 +05:00
2016-02-12 20:42:03 +05:00
2016-02-12 20:42:03 +05:00