Jim Jewett <jimjjew...@gmail.com> added the comment: On Fri, Apr 6, 2012 at 5:57 AM, Antoine Pitrou <rep...@bugs.python.org> wrote: > Antoine Pitrou <pit...@free.fr> added the comment:
>> > Not sure what you're talking about. The doc patch is about unacquired >> > locks, not locks that someone else (another thread) holds. >> Isn't one common reason for not being able to acquire a lock that >> someone else was already holding it? > We're talking about *releasing* an (un)acquired lock, not acquiring it > again... Right, but I thought the original motivation was concern over a race condition in the lock acquisition. lock.acquire() try: # What if something happens here, during try setup? Leak? foo() finally: lock.release() vs try: lock.acquire() foo() finally: lock.release() # But what if the acquire failed? -jJ ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14502> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com