Jim Jewett <[email protected]> added the comment:

On Fri, Apr 6, 2012 at 5:57 AM, Antoine Pitrou <[email protected]> wrote:
> Antoine Pitrou <[email protected]> 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 <[email protected]>
<http://bugs.python.org/issue14502>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to