[pypy-commit] pypy ec-threadlocal: Force the inclusion of 'src/threadlocal.*' from here,

arigo noreply at buildbot.pypy.org
Mon Jun 23 19:49:17 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: ec-threadlocal
Changeset: r72169:e0a6a161c834
Date: 2014-06-23 19:48 +0200
http://bitbucket.org/pypy/pypy/changeset/e0a6a161c834/

Log:	Force the inclusion of 'src/threadlocal.*' from here, needed in
	particular when we're compiling the no__thread version.

diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -281,6 +281,11 @@
 # KEEP THE REFERENCE ALIVE, THE GC DOES NOT FOLLOW THEM SO FAR!
 # We use _make_sure_does_not_move() to make sure the pointer will not move.
 
+ecitl = ExternalCompilationInfo(
+    includes = ['src/threadlocal.h'],
+    separate_module_files = [translator_c_dir / 'src' / 'threadlocal.c'])
+ensure_threadlocal = rffi.llexternal_use_eci(ecitl)
+
 class ThreadLocalReference(object):
     _COUNT = 1
     OPAQUEID = lltype.OpaqueType("ThreadLocalRef",
@@ -320,6 +325,7 @@
                     gcref = lltype.cast_opaque_ptr(llmemory.GCREF, ptr)
                     _make_sure_does_not_move(gcref)
                 llop.threadlocalref_set(lltype.Void, opaque_id, ptr)
+                ensure_threadlocal()
             else:
                 self.local.value = value
 


More information about the pypy-commit mailing list