[pypy-commit] pypy default: Use RLock instead of Lock. The goal is to ensure that only one thread

arigo noreply at buildbot.pypy.org
Mon Mar 16 17:12:25 CET 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r76410:ca92ff804835
Date: 2015-03-16 17:11 +0100
http://bitbucket.org/pypy/pypy/changeset/ca92ff804835/

Log:	Use RLock instead of Lock. The goal is to ensure that only one
	thread at a time uses tkinter, if the C library is "non-threaded".
	But we're getting rare cases of deadlocks even with only one thread,
	which is likely a rare path ending up in a recursive locking.

diff --git a/lib_pypy/_tkinter/app.py b/lib_pypy/_tkinter/app.py
--- a/lib_pypy/_tkinter/app.py
+++ b/lib_pypy/_tkinter/app.py
@@ -96,7 +96,7 @@
 
         if not self.threaded:
             # TCL is not thread-safe, calls needs to be serialized.
-            self._tcl_lock = threading.Lock()
+            self._tcl_lock = threading.RLock()
         else:
             self._tcl_lock = _DummyLock()
 


More information about the pypy-commit mailing list