[Python-Dev] Proposed addition to threading module (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Mon Apr 24 08:37:24 CEST 2006
- Previous message: [Python-Dev] Proposed addition to threading module - released
- Next message: [Python-Dev] Proposed addition to threading module - released
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nick Coghlan wrote:
Do we want to add a "released" context manager to the threading module for 2.5?
I don't think that should be added. I would consider it a dangerous programming style: if the lock merely doesn't "need" to be held (i.e. if it isn't necessary, but won't hurt), one should just keep holding the lock. If it is essential to release the lock, because the code would otherwise deadlock, the code should be dramatically revised to avoid that situation, e.g. by redefining the granularity of the lock, and moving the with statements accordingly.
Regards, Martin
- Previous message: [Python-Dev] Proposed addition to threading module - released
- Next message: [Python-Dev] Proposed addition to threading module - released
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]