[pypy-svn] r45739 - in pypy/branch/pypy-more-rtti-inprogress/module/thread: . rpython test

fijal at codespeak.net fijal at codespeak.net
Thu Aug 16 18:28:43 CEST 2007


Author: fijal
Date: Thu Aug 16 18:28:42 2007
New Revision: 45739

Removed:
   pypy/branch/pypy-more-rtti-inprogress/module/thread/rpython/
Modified:
   pypy/branch/pypy-more-rtti-inprogress/module/thread/gil.py
   pypy/branch/pypy-more-rtti-inprogress/module/thread/ll_thread.py
   pypy/branch/pypy-more-rtti-inprogress/module/thread/os_local.py
   pypy/branch/pypy-more-rtti-inprogress/module/thread/os_lock.py
   pypy/branch/pypy-more-rtti-inprogress/module/thread/os_thread.py
   pypy/branch/pypy-more-rtti-inprogress/module/thread/test/test_thread.py
   pypy/branch/pypy-more-rtti-inprogress/module/thread/threadlocals.py
Log:
Move threads from extfunctable to rffi


Modified: pypy/branch/pypy-more-rtti-inprogress/module/thread/gil.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/module/thread/gil.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/module/thread/gil.py	Thu Aug 16 18:28:42 2007
@@ -7,11 +7,10 @@
 # all but one will be blocked.  The other threads get a chance to run
 # from time to time, using the executioncontext's XXX
 
-import thread
+from pypy.module.thread import ll_thread as thread
 from pypy.interpreter.miscutils import Action
 from pypy.module.thread.threadlocals import OSThreadLocals
 
-
 class GILThreadLocals(OSThreadLocals):
     """A version of OSThreadLocals that enforces a GIL."""
 

Modified: pypy/branch/pypy-more-rtti-inprogress/module/thread/ll_thread.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/module/thread/ll_thread.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/module/thread/ll_thread.py	Thu Aug 16 18:28:42 2007
@@ -47,7 +47,7 @@
 c_thread_start = llexternal('RPyThreadStart', [CALLBACK, rffi.VOIDP], rffi.INT)
 c_thread_get_ident = llexternal('RPyThreadGetIdent', [], lltype.Void)
 
-TLOCKP = rffi.COpaque('struct RPyOpaque_ThreadLock', includes=includes)
+TLOCKP = rffi.COpaquePtr('struct RPyOpaque_ThreadLock', includes=includes)
 
 c_thread_lock_init = llexternal('RPyThreadLockInit', [TLOCKP], lltype.Void)
 c_thread_acuirelock = llexternal('RPyThreadAcquireLock', [TLOCKP, rffi.INT],

Modified: pypy/branch/pypy-more-rtti-inprogress/module/thread/os_local.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/module/thread/os_local.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/module/thread/os_local.py	Thu Aug 16 18:28:42 2007
@@ -1,4 +1,4 @@
-import thread
+from pypy.module.thread import ll_thread as thread
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.typedef import TypeDef, interp2app
@@ -6,9 +6,6 @@
 from pypy.interpreter.typedef import descr_set_dict
 from pypy.interpreter.gateway import ObjSpace, W_Root, Arguments
 
-# Force the declaration of thread.start_new_thread() & co. for RPython
-import pypy.module.thread.rpython.exttable
-
 
 class Local(Wrappable):
     """Thread-local data"""

Modified: pypy/branch/pypy-more-rtti-inprogress/module/thread/os_lock.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/module/thread/os_lock.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/module/thread/os_lock.py	Thu Aug 16 18:28:42 2007
@@ -2,14 +2,14 @@
 Python locks, based on true threading locks provided by the OS.
 """
 
-import thread
+from pypy.module.thread import ll_thread as thread
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.gateway import ObjSpace, interp2app
 from pypy.interpreter.typedef import TypeDef
 
 # Force the declaration of the type 'thread.LockType' for RPython
-import pypy.module.thread.rpython.exttable
+#import pypy.module.thread.rpython.exttable
 
 
 ##import sys

Modified: pypy/branch/pypy-more-rtti-inprogress/module/thread/os_thread.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/module/thread/os_thread.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/module/thread/os_thread.py	Thu Aug 16 18:28:42 2007
@@ -2,19 +2,17 @@
 Thread support based on OS-level threads.
 """
 
-import thread
+from pypy.module.thread import ll_thread as thread
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import NoneNotWrapped
 from pypy.interpreter.gateway import ObjSpace, W_Root, Arguments
 
-# Force the declaration of thread.start_new_thread() & co. for RPython
-import pypy.module.thread.rpython.exttable
-
-
 THREAD_STARTUP_LOCK = thread.allocate_lock()
 
 
 class Bootstrapper:
+    _alloc_flavor_ = 'raw'
+    
     def bootstrap(self):
         space = self.space
         THREAD_STARTUP_LOCK.release()
@@ -35,6 +33,7 @@
             # clean up space.threadlocals to remove the ExecutionContext
             # entry corresponding to the current thread
             space.threadlocals.leave_thread(space)
+            # free self here?
 
     def run(self):
         space      = self.space

Modified: pypy/branch/pypy-more-rtti-inprogress/module/thread/test/test_thread.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/module/thread/test/test_thread.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/module/thread/test/test_thread.py	Thu Aug 16 18:28:42 2007
@@ -1,6 +1,5 @@
 from pypy.module.thread.test.support import GenericTestThread
 
-
 class AppTestThread(GenericTestThread):
 
     def test_start_new_thread(self):

Modified: pypy/branch/pypy-more-rtti-inprogress/module/thread/threadlocals.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/module/thread/threadlocals.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/module/thread/threadlocals.py	Thu Aug 16 18:28:42 2007
@@ -1,8 +1,4 @@
-import thread
-
-# Force the declaration of thread.start_new_thread() & co. for RPython
-import pypy.module.thread.rpython.exttable
-
+from pypy.module.thread import ll_thread as thread
 
 class OSThreadLocals:
     """Thread-local storage for OS-level threads.



More information about the Pypy-commit mailing list