[pypy-issue] [issue1340] stm-thread-2: Double acquire of lock when atomic

Remi tracker at bugs.pypy.org
Sun Nov 25 16:21:20 CET 2012


New submission from Remi <remi.meier at gmail.com>:

Example:
------------------------
import Queue
from thread import atomic
q = Queue.Queue()
with atomic:
    q.get()
------------------------
Output:
error: deadlock: an atomic transaction tries to acquire a lock that is already 
acquired.  See pypy/doc/stm.rst.
------------------------
Reason:
Queue() depends on Condition() which implements wait() by acquiring an already acquired 
lock. Other example:
------------------------
import thread
from thread import atomic
q = thread.allocate_lock()
with atomic:
    l.acquire()
    l.acquire()
------------------------

----------
messages: 5037
nosy: Remi, pypy-issue
priority: bug
status: unread
title: stm-thread-2: Double acquire of lock when atomic

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1340>
________________________________________


More information about the pypy-issue mailing list