Issue1789

classification
Title: threading.Lock.acquire doesn't block at all
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: alex, fwierzbicki
Priority: Keywords:

Created on 2011-08-16.12:03:45 by alex, last changed 2013-02-25.19:24:53 by fwierzbicki.

Messages
msg6603 (view) Author: A. Fox (alex) Date: 2011-08-16.12:03:45
Multiple calls to Lock.acquire are possible:

>>> from threading import Lock
>>> l=Lock()
>>> l.acquire()
True
>>> l.acquire()
True
msg6620 (view) Author: A. Fox (alex) Date: 2011-08-29.11:46:57
It is by purpose, as written in the jython book. So it is not a bug.

From http://www.jython.org/jythonbook/en/1.0/Concurrency.html

A threading.Lock ensures entry by only one thread. (In Jython, but unlike CPython, such locks are always reentrant; there’s no distinction between threading.Lock and threading.RLock.) Other threads have to wait until that thread exits the lock. Such explicit locks are the simplest and perhaps most portable synchronization to perform.
msg7740 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-25.19:24:53
Looks like this can be closed. Thanks for the follow up!
History
Date User Action Args
2013-02-25 19:24:53fwierzbickisetstatus: open -> closed
resolution: wont fix
messages: + msg7740
nosy: + fwierzbicki
versions: + Jython 2.5, - 2.5.2
2011-08-29 11:46:58alexsetmessages: + msg6620
2011-08-16 12:03:45alexcreate