[pypy-commit] pypy split-rpython: pypy.module.thread.ll_thread -> rpython.rlib.rthread

Aquana noreply at buildbot.pypy.org
Sat Jan 5 23:16:56 CET 2013


Author: Alexander Hesse <webmaster at aquanasoft.de>
Branch: split-rpython
Changeset: r59795:c192bbff8225
Date: 2013-01-05 22:53 +0100
http://bitbucket.org/pypy/pypy/changeset/c192bbff8225/

Log:	pypy.module.thread.ll_thread -> rpython.rlib.rthread

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -627,7 +627,7 @@
             return dummy_lock
 
     def __allocate_lock(self):
-        from pypy.module.thread.ll_thread import allocate_lock, error
+        from rpython.rlib.rthread import allocate_lock, error
         try:
             return allocate_lock()
         except error:
diff --git a/pypy/module/_io/interp_bufferedio.py b/pypy/module/_io/interp_bufferedio.py
--- a/pypy/module/_io/interp_bufferedio.py
+++ b/pypy/module/_io/interp_bufferedio.py
@@ -12,7 +12,7 @@
     W_IOBase, DEFAULT_BUFFER_SIZE, convert_size,
     check_readable_w, check_writable_w, check_seekable_w)
 from pypy.module._io.interp_io import W_BlockingIOError
-from pypy.module.thread import ll_thread
+from rpython.rlib import rthread
 import errno
 
 STATE_ZERO, STATE_OK, STATE_DETACHED = range(3)
diff --git a/pypy/module/_multiprocessing/interp_semaphore.py b/pypy/module/_multiprocessing/interp_semaphore.py
--- a/pypy/module/_multiprocessing/interp_semaphore.py
+++ b/pypy/module/_multiprocessing/interp_semaphore.py
@@ -8,7 +8,7 @@
 from rpython.rlib.rarithmetic import r_uint
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from rpython.rtyper.tool import rffi_platform as platform
-from pypy.module.thread import ll_thread
+from rpython.rlib import rthread
 from pypy.module._multiprocessing.interp_connection import w_handle
 import sys, os, time, errno
 
diff --git a/pypy/module/_ssl/thread_lock.py b/pypy/module/_ssl/thread_lock.py
--- a/pypy/module/_ssl/thread_lock.py
+++ b/pypy/module/_ssl/thread_lock.py
@@ -62,7 +62,7 @@
 }
 """
 
-from pypy.module.thread import ll_thread
+from rpython.rlib import rthread
 
 eci = ll_thread.eci.merge(ExternalCompilationInfo(
     separate_module_sources=[separate_module_source],
diff --git a/pypy/module/cpyext/pystate.py b/pypy/module/cpyext/pystate.py
--- a/pypy/module/cpyext/pystate.py
+++ b/pypy/module/cpyext/pystate.py
@@ -2,7 +2,8 @@
     cpython_api, generic_cpy_call, CANNOT_FAIL, CConfig, cpython_struct)
 from pypy.module.cpyext.pyobject import PyObject, Py_DecRef, make_ref, from_ref
 from rpython.rtyper.lltypesystem import rffi, lltype
-from pypy.module.thread import ll_thread, os_thread
+from rpython.rlib import rthread
+from pypy.module.thread import os_thread
 
 PyInterpreterStateStruct = lltype.ForwardReference()
 PyInterpreterState = lltype.Ptr(PyInterpreterStateStruct)
diff --git a/pypy/module/rctime/interp_time.py b/pypy/module/rctime/interp_time.py
--- a/pypy/module/rctime/interp_time.py
+++ b/pypy/module/rctime/interp_time.py
@@ -30,7 +30,7 @@
     # and the wait function exits.
     from rpython.rlib import rwin32
     from pypy.interpreter.error import wrap_windowserror, wrap_oserror
-    from pypy.module.thread import ll_thread as thread
+    from rpython.rlib import rthread as thread
 
     eci = ExternalCompilationInfo(
         includes = ['windows.h'],
diff --git a/pypy/module/thread/gil.py b/pypy/module/thread/gil.py
--- a/pypy/module/thread/gil.py
+++ b/pypy/module/thread/gil.py
@@ -7,7 +7,7 @@
 # all but one will be blocked.  The other threads get a chance to run
 # from time to time, using the periodic action GILReleaseAction.
 
-from pypy.module.thread import ll_thread as thread
+from rpython.rlib import rthread as thread
 from pypy.module.thread.error import wrap_thread_error
 from pypy.interpreter.executioncontext import PeriodicAsyncAction
 from pypy.module.thread.threadlocals import OSThreadLocals
diff --git a/pypy/module/thread/os_lock.py b/pypy/module/thread/os_lock.py
--- a/pypy/module/thread/os_lock.py
+++ b/pypy/module/thread/os_lock.py
@@ -2,7 +2,7 @@
 Python locks, based on true threading locks provided by the OS.
 """
 
-from pypy.module.thread import ll_thread as thread
+from rpython.rlib import rthread as thread
 from pypy.module.thread.error import wrap_thread_error
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.gateway import interp2app, unwrap_spec
diff --git a/pypy/module/thread/os_thread.py b/pypy/module/thread/os_thread.py
--- a/pypy/module/thread/os_thread.py
+++ b/pypy/module/thread/os_thread.py
@@ -2,7 +2,7 @@
 Thread support based on OS-level threads.
 """
 
-from pypy.module.thread import ll_thread as thread
+from rpython.rlib import rthread as thread
 from pypy.module.thread.error import wrap_thread_error
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.gateway import unwrap_spec, Arguments
diff --git a/pypy/module/thread/test/test_gil.py b/pypy/module/thread/test/test_gil.py
--- a/pypy/module/thread/test/test_gil.py
+++ b/pypy/module/thread/test/test_gil.py
@@ -1,7 +1,7 @@
 import time
 from pypy.module.thread import gil
 from pypy.module.thread.test import test_ll_thread
-from pypy.module.thread import ll_thread as thread
+from rpython.rlib import rthread as thread
 from rpython.rlib.objectmodel import we_are_translated
 
 class FakeEC(object):
diff --git a/pypy/module/thread/test/test_ll_thread.py b/pypy/module/thread/test/test_ll_thread.py
--- a/pypy/module/thread/test/test_ll_thread.py
+++ b/pypy/module/thread/test/test_ll_thread.py
@@ -1,5 +1,5 @@
 import gc
-from pypy.module.thread.ll_thread import *
+from rpython.rlib.rthread import *
 from rpython.translator.c.test.test_boehm import AbstractGCTestClass
 from rpython.rtyper.lltypesystem import lltype, rffi
 import py
diff --git a/pypy/module/thread/test/test_lock.py b/pypy/module/thread/test/test_lock.py
--- a/pypy/module/thread/test/test_lock.py
+++ b/pypy/module/thread/test/test_lock.py
@@ -48,7 +48,7 @@
 
 def test_compile_lock():
     from rpython.rlib import rgc
-    from pypy.module.thread.ll_thread import allocate_lock
+    from rpython.rlib.rthread import allocate_lock
     def g():
         l = allocate_lock()
         ok1 = l.acquire(True)
diff --git a/pypy/module/thread/threadlocals.py b/pypy/module/thread/threadlocals.py
--- a/pypy/module/thread/threadlocals.py
+++ b/pypy/module/thread/threadlocals.py
@@ -1,4 +1,4 @@
-from pypy.module.thread import ll_thread as thread
+from rpython.rlib import rthread as thread
 
 
 class OSThreadLocals:
diff --git a/pypy/module/thread/ll_thread.py b/rpython/rlib/rthread.py
rename from pypy/module/thread/ll_thread.py
rename to rpython/rlib/rthread.py
--- a/pypy/module/thread/ll_thread.py
+++ b/rpython/rlib/rthread.py
@@ -8,12 +8,10 @@
 from rpython.rlib.objectmodel import we_are_translated, specialize
 from rpython.rtyper.lltypesystem.lloperation import llop
 from rpython.rtyper.tool import rffi_platform
-from pypy.conftest import pypydir
 
 class error(Exception):
     pass
 
-pypydir = py.path.local(pypydir)
 translator_c_dir = py.path.local(cdir)
 
 eci = ExternalCompilationInfo(
diff --git a/rpython/rtyper/memory/gctransform/asmgcroot.py b/rpython/rtyper/memory/gctransform/asmgcroot.py
--- a/rpython/rtyper/memory/gctransform/asmgcroot.py
+++ b/rpython/rtyper/memory/gctransform/asmgcroot.py
@@ -159,7 +159,7 @@
         # gc_thread_before_fork and gc_thread_after_fork to get rid of
         # all ASM_FRAMEDATA structures that do no belong to the current
         # thread after a fork().
-        from pypy.module.thread import ll_thread
+        from rpython.rlib import rthread
         from rpython.rtyper.memory.support import AddressDict
         from rpython.rtyper.memory.support import copy_without_null_values
         from rpython.annotator import model as annmodel
diff --git a/rpython/rtyper/memory/gctransform/shadowstack.py b/rpython/rtyper/memory/gctransform/shadowstack.py
--- a/rpython/rtyper/memory/gctransform/shadowstack.py
+++ b/rpython/rtyper/memory/gctransform/shadowstack.py
@@ -105,7 +105,7 @@
                            gcdata.root_stack_base, gcdata.root_stack_top)
 
     def need_thread_support(self, gctransformer, getfn):
-        from pypy.module.thread import ll_thread    # xxx fish
+        from rpython.rlib import rthread    # xxx fish
         gcdata = self.gcdata
         # the interfacing between the threads and the GC is done via
         # two completely ad-hoc operations at the moment:
diff --git a/rpython/rtyper/module/ll_os.py b/rpython/rtyper/module/ll_os.py
--- a/rpython/rtyper/module/ll_os.py
+++ b/rpython/rtyper/module/ll_os.py
@@ -1635,7 +1635,7 @@
 
     @registering_if(os, 'fork')
     def register_os_fork(self):
-        from pypy.module.thread import ll_thread
+        from rpython.rlib import rthread
         eci = self.gcc_profiling_bug_workaround('pid_t _noprof_fork(void)',
                                                 'return fork();')
         os_fork = self.llexternal('_noprof_fork', [], rffi.PID_T,
diff --git a/rpython/translator/c/test/test_standalone.py b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -852,7 +852,7 @@
 
     def test_stack_size(self):
         import time
-        from pypy.module.thread import ll_thread
+        from rpython.rlib import rthread
         from rpython.rtyper.lltypesystem import lltype
         from rpython.rlib.objectmodel import invoke_around_extcall
 
@@ -951,7 +951,7 @@
 
     def test_thread_and_gc(self):
         import time, gc
-        from pypy.module.thread import ll_thread
+        from rpython.rlib import rthread
         from rpython.rtyper.lltypesystem import lltype
         from rpython.rlib.objectmodel import invoke_around_extcall
 
@@ -1056,7 +1056,7 @@
         # least that the object referenced from stacks that are no longer
         # alive are really freed.
         import time, gc, os
-        from pypy.module.thread import ll_thread
+        from rpython.rlib import rthread
         from rpython.rlib.objectmodel import invoke_around_extcall
         if not hasattr(os, 'fork'):
             py.test.skip("requires fork()")


More information about the pypy-commit mailing list