This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bjs
Recipients Kevin Shweh, SnoopJeDi, bjs, vstinner
Date 2022-02-12.00:33:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644625985.49.0.545314334135.issue46726@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2022-02-12 00:33:05bjssetrecipients: + bjs, vstinner, Kevin Shweh, SnoopJeDi
2022-02-12 00:33:05bjssetmessageid: <1644625985.49.0.545314334135.issue46726@roundup.psfhosted.org>
2022-02-12 00:33:05bjslinkissue46726 messages
2022-02-12 00:33:05bjscreate