Message413110
You are right,
What one really needs here is a way to know *who* owns the lock,
but threading.Lock does not provide that.
The race on := is much smaller than the original race and I suspect in practice will be very hard to hit.
As the original bpo notes, it may not be possible to write a complete fix for this in pure Python, after all there may always be another interrupt between the `except` and the second attempted `release`.
The issue with the solution was that it turned a relatively hard-to-hit race condition into a really easy-to-hit one, but perhaps the outcome is slightly less worse? |
|
Date |
User |
Action |
Args |
2022-02-12 00:33:05 | bjs | set | recipients:
+ bjs, vstinner, Kevin Shweh, SnoopJeDi |
2022-02-12 00:33:05 | bjs | set | messageid: <1644625985.49.0.545314334135.issue46726@roundup.psfhosted.org> |
2022-02-12 00:33:05 | bjs | link | issue46726 messages |
2022-02-12 00:33:05 | bjs | create | |
|