[pypy-commit] pypy default: Turn this class into a thread-local storage, to fix issues in case

arigo noreply at buildbot.pypy.org
Fri Jun 5 10:48:36 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r77888:741893a5757c
Date: 2015-06-05 10:39 +0200
http://bitbucket.org/pypy/pypy/changeset/741893a5757c/

Log:	Turn this class into a thread-local storage, to fix issues in case
	it's used by multiple threads

diff --git a/rpython/tool/flattenrec.py b/rpython/tool/flattenrec.py
--- a/rpython/tool/flattenrec.py
+++ b/rpython/tool/flattenrec.py
@@ -3,8 +3,14 @@
 parts until later.
 """
 
+try:
+    from thread import _local as TlsClass
+except ImportError:
+    class TlsClass(object):
+        pass
 
-class FlattenRecursion(object):
+
+class FlattenRecursion(TlsClass):
 
     def __init__(self):
         self.later = None


More information about the pypy-commit mailing list