Commits

Alexander Hesse committed 021e4df

Fixed missing rename of ll_thread

Comments (0)

Files changed (12)

pypy/module/_io/interp_bufferedio.py

 
     def __enter__(self):
         if not self.lock.acquire(False):
-            if self.owner == ll_thread.get_ident():
+            if self.owner == rthread.get_ident():
                 raise self.operr
             self.lock.acquire(True)
-        self.owner = ll_thread.get_ident()
+        self.owner = rthread.get_ident()
     
     def __exit__(self,*args):
         self.owner = 0

pypy/module/_multiprocessing/interp_semaphore.py

         return space.wrap(self.count)
 
     def _ismine(self):
-        return self.count > 0 and ll_thread.get_ident() == self.last_tid
+        return self.count > 0 and rthread.get_ident() == self.last_tid
 
     def is_mine(self, space):
         return space.wrap(self._ismine())
             raise wrap_oserror(space, e)
 
         if got:
-            self.last_tid = ll_thread.get_ident()
+            self.last_tid = rthread.get_ident()
             self.count += 1
             return space.w_True
         else:

pypy/module/_ssl/thread_lock.py

 
 from rpython.rlib import rthread
 
-eci = ll_thread.eci.merge(ExternalCompilationInfo(
+eci = rthread.eci.merge(ExternalCompilationInfo(
     separate_module_sources=[separate_module_source],
     post_include_bits=[
         "int _PyPy_SSL_SetupThreads(void);"],

pypy/module/cpyext/pystate.py

     """Create a new thread state object belonging to the given interpreter
     object.  The global interpreter lock need not be held, but may be held if
     it is necessary to serialize calls to this function."""
-    ll_thread.gc_thread_prepare()
+    rthread.gc_thread_prepare()
     # PyThreadState_Get will allocate a new execution context,
     # we need to protect gc and other globals with the GIL.
     rffi.aroundstate.after()
     try:
-        ll_thread.gc_thread_start()
+        rthread.gc_thread_start()
         return PyThreadState_Get(space)
     finally:
         rffi.aroundstate.before()
     tstate.c_dict = lltype.nullptr(PyObject.TO)
     space.threadlocals.leave_thread(space)
     space.getexecutioncontext().cleanup_cpyext_state()
-    ll_thread.gc_thread_die()
+    rthread.gc_thread_die()
 
 @cpython_api([PyThreadState], lltype.Void)
 def PyThreadState_Delete(space, tstate):

pypy/module/thread/os_thread.py

 class Bootstrapper(object):
     "A global container used to pass information to newly starting threads."
 
-    # Passing a closure argument to ll_thread.start_new_thread() would be
+    # Passing a closure argument to rthread.start_new_thread() would be
     # theoretically nicer, but comes with messy memory management issues.
     # This is much more straightforward.
 

pypy/module/thread/test/test_gil.py

 import time
 from pypy.module.thread import gil
-from pypy.module.thread.test import test_ll_thread
+from pypy.module.thread.test import test_rthread
 from rpython.rlib import rthread as thread
 from rpython.rlib.objectmodel import we_are_translated
 
         raise NotImplementedError
 
 
-class GILTests(test_ll_thread.AbstractGCTestClass):
+class GILTests(test_rthread.AbstractGCTestClass):
     use_threads = True
     bigtest = False
 

pypy/module/thread/test/test_ll_thread.py

 
 def setup_module(mod):
     # Hack to avoid a deadlock if the module is run after other test files :-(
-    # In this module, we assume that ll_thread.start_new_thread() is not
+    # In this module, we assume that rthread.start_new_thread() is not
     # providing us with a GIL equivalent, except in test_gc_locking
     # which installs its own aroundstate.
     rffi.aroundstate._cleanup_()

rpython/rtyper/memory/gctransform/asmgcroot.py

 
         def get_aid():
             """Return the thread identifier, cast to an (opaque) address."""
-            return llmemory.cast_int_to_adr(ll_thread.get_ident())
+            return llmemory.cast_int_to_adr(rthread.get_ident())
 
         def thread_start():
             value = llop.stack_current(llmemory.Address)

rpython/rtyper/memory/gctransform/shadowstack.py

         gcdata.thread_stacks = None
 
         # Return the thread identifier, as an integer.
-        get_tid = ll_thread.get_ident
+        get_tid = rthread.get_ident
 
         def thread_setup():
             tid = get_tid()

rpython/rtyper/module/ll_os.py

                                   _nowrapper = True)
 
         def fork_llimpl():
-            opaqueaddr = ll_thread.gc_thread_before_fork()
+            opaqueaddr = rthread.gc_thread_before_fork()
             childpid = rffi.cast(lltype.Signed, os_fork())
-            ll_thread.gc_thread_after_fork(childpid, opaqueaddr)
+            rthread.gc_thread_after_fork(childpid, opaqueaddr)
             if childpid == -1:
                 raise OSError(rposix.get_errno(), "os_fork failed")
             return rffi.cast(lltype.Signed, childpid)

rpython/translator/c/gc.py

         eci = eci.merge(ExternalCompilationInfo(
             pre_include_bits=pre_include_bits,
             # The following define is required by the thread module,
-            # See module/thread/test/test_ll_thread.py
+            # See module/thread/test/test_rthread.py
             compile_extra=['-DPYPY_USING_BOEHM_GC'],
             ))
 

rpython/translator/c/test/test_standalone.py

 
         def before():
             debug_print("releasing...")
-            ll_assert(not ll_thread.acquire_NOAUTO(state.ll_lock, False),
+            ll_assert(not rthread.acquire_NOAUTO(state.ll_lock, False),
                       "lock not held!")
-            ll_thread.release_NOAUTO(state.ll_lock)
+            rthread.release_NOAUTO(state.ll_lock)
             debug_print("released")
         def after():
             debug_print("waiting...")
-            ll_thread.acquire_NOAUTO(state.ll_lock, True)
+            rthread.acquire_NOAUTO(state.ll_lock, True)
             debug_print("acquired")
 
         def recurse(n):
 
         def entry_point(argv):
             os.write(1, "hello world\n")
-            error = ll_thread.set_stacksize(int(argv[1]))
+            error = rthread.set_stacksize(int(argv[1]))
             if error != 0:
                 os.write(2, "set_stacksize(%d) returned %d\n" % (
                     int(argv[1]), error))
             s1 = State(); s2 = State(); s3 = State()
             s1.x = 0x11111111; s2.x = 0x22222222; s3.x = 0x33333333
             # start 3 new threads
-            state.ll_lock = ll_thread.allocate_ll_lock()
+            state.ll_lock = rthread.allocate_ll_lock()
             after()
             state.count = 0
             invoke_around_extcall(before, after)
-            ident1 = ll_thread.start_new_thread(bootstrap, ())
-            ident2 = ll_thread.start_new_thread(bootstrap, ())
-            ident3 = ll_thread.start_new_thread(bootstrap, ())
+            ident1 = rthread.start_new_thread(bootstrap, ())
+            ident2 = rthread.start_new_thread(bootstrap, ())
+            ident3 = rthread.start_new_thread(bootstrap, ())
             # wait for the 3 threads to finish
             while True:
                 if state.count == 3:
         state = State()
 
         def before():
-            ll_assert(not ll_thread.acquire_NOAUTO(state.ll_lock, False),
+            ll_assert(not rthread.acquire_NOAUTO(state.ll_lock, False),
                       "lock not held!")
-            ll_thread.release_NOAUTO(state.ll_lock)
+            rthread.release_NOAUTO(state.ll_lock)
         def after():
-            ll_thread.acquire_NOAUTO(state.ll_lock, True)
-            ll_thread.gc_thread_run()
+            rthread.acquire_NOAUTO(state.ll_lock, True)
+            rthread.gc_thread_run()
 
         class Cons:
             def __init__(self, head, tail):
                 self.tail = tail
 
         def bootstrap():
-            ll_thread.gc_thread_start()
+            rthread.gc_thread_start()
             state.xlist.append(Cons(123, Cons(456, None)))
             gc.collect()
-            ll_thread.gc_thread_die()
+            rthread.gc_thread_die()
 
         def new_thread():
-            ll_thread.gc_thread_prepare()
-            ident = ll_thread.start_new_thread(bootstrap, ())
+            rthread.gc_thread_prepare()
+            ident = rthread.start_new_thread(bootstrap, ())
             time.sleep(0.5)    # enough time to start, hopefully
             return ident
 
             state.xlist = []
             x2 = Cons(51, Cons(62, Cons(74, None)))
             # start 5 new threads
-            state.ll_lock = ll_thread.allocate_ll_lock()
+            state.ll_lock = rthread.allocate_ll_lock()
             after()
             invoke_around_extcall(before, after)
             ident1 = new_thread()
         state = State()
 
         def before():
-            ll_assert(not ll_thread.acquire_NOAUTO(state.ll_lock, False),
+            ll_assert(not rthread.acquire_NOAUTO(state.ll_lock, False),
                       "lock not held!")
-            ll_thread.release_NOAUTO(state.ll_lock)
+            rthread.release_NOAUTO(state.ll_lock)
         def after():
-            ll_thread.acquire_NOAUTO(state.ll_lock, True)
-            ll_thread.gc_thread_run()
+            rthread.acquire_NOAUTO(state.ll_lock, True)
+            rthread.gc_thread_run()
 
         class Cons:
             def __init__(self, head, tail):
             return childpid
 
         def bootstrap():
-            ll_thread.gc_thread_start()
+            rthread.gc_thread_start()
             childpid = run_in_thread()
             gc.collect()        # collect both in the child and in the parent
             gc.collect()
                 os.write(state.write_end, 'c')   # "I did not die!" from child
             else:
                 os.write(state.write_end, 'p')   # "I did not die!" from parent
-            ll_thread.gc_thread_die()
+            rthread.gc_thread_die()
 
         def new_thread():
-            ll_thread.gc_thread_prepare()
-            ident = ll_thread.start_new_thread(bootstrap, ())
+            rthread.gc_thread_prepare()
+            ident = rthread.start_new_thread(bootstrap, ())
             time.sleep(0.5)    # enough time to start, hopefully
             return ident
 
-        def start_all_threads():
+        def start_arthreads():
             s = allocate_stuff()
             ident1 = new_thread()
             ident2 = new_thread()
             state.read_end, state.write_end = os.pipe()
             x2 = Cons(51, Cons(62, Cons(74, None)))
             # start 5 new threads
-            state.ll_lock = ll_thread.allocate_ll_lock()
+            state.ll_lock = rthread.allocate_ll_lock()
             after()
             invoke_around_extcall(before, after)
-            start_all_threads()
+            start_arthreads()
             # force freeing
             gc.collect()
             gc.collect()