Author: Armin Rigo <[email protected]>
Branch: concurrent-marksweep
Changeset: r47866:08367abdb6d8
Date: 2011-10-07 17:56 +0200
http://bitbucket.org/pypy/pypy/changeset/08367abdb6d8/

Log:    Use a real thread-local storage in lltype. Needed to run the tests
        of the concurrent GC.

diff --git a/pypy/rpython/lltypesystem/ll2ctypes.py 
b/pypy/rpython/lltypesystem/ll2ctypes.py
--- a/pypy/rpython/lltypesystem/ll2ctypes.py
+++ b/pypy/rpython/lltypesystem/ll2ctypes.py
@@ -27,11 +27,6 @@
 from pypy.rpython import raddress
 from pypy.translator.platform import platform
 from array import array
-try:
-    from thread import _local as tlsobject
-except ImportError:
-    class tlsobject(object):
-        pass
 
 # ____________________________________________________________
 
@@ -1339,7 +1334,7 @@
 # call to the next.  Otherwise a non-zero value left behind will confuse
 # CPython itself a bit later, and/or CPython will stamp on it before we
 # try to inspect it via rposix.get_errno().
-TLS = tlsobject()
+TLS = lltype.tlsobject()
 
 # helpers to save/restore the C-level errno -- platform-specific because
 # ctypes doesn't just do the right thing and expose it directly :-(
diff --git a/pypy/rpython/lltypesystem/lltype.py 
b/pypy/rpython/lltypesystem/lltype.py
--- a/pypy/rpython/lltypesystem/lltype.py
+++ b/pypy/rpython/lltypesystem/lltype.py
@@ -10,10 +10,13 @@
 from sys import maxint
 import weakref
 
-class State(object):
-    pass
+try:
+    from thread import _local as tlsobject
+except ImportError:
+    class tlsobject(object):
+        pass
 
-TLS = State()
+TLS = tlsobject()
 
 class WeakValueDictionary(weakref.WeakValueDictionary):
     """A subclass of weakref.WeakValueDictionary
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to