Commits

Armin Rigo committed 18482c0

Fix the 'transaction' module too.

  • Participants
  • Parent commits cb64c1f
  • Branches stm-gc

Comments (0)

Files changed (2)

File pypy/module/transaction/interp_transaction.py

 def _run():
     # --- start the threads --- don't use the GC here any more! ---
     for i in range(state.num_threads):
-        threadintf.start_new_thread(_run_thread, ())
+        threadintf.start_new_thread(_run_thread)
     #
     state.lock_unfinished()  # wait for all threads to finish
     # --- done, we can use the GC again ---

File pypy/module/transaction/threadintf.py

 import thread
 from pypy.module.thread import ll_thread
 from pypy.rlib.objectmodel import we_are_translated
+from pypy.rpython.annlowlevel import llhelper
+from pypy.rlib.debug import fatalerror
 
 
 null_ll_lock = ll_thread.null_ll_lock
     else:
         lock.release()
 
-def start_new_thread(callback, args):
-    assert args == ()
+def start_new_thread(callback):
     if we_are_translated():
-        ll_thread.start_new_thread(callback, args)
+        llcallback = llhelper(ll_thread.CALLBACK, callback)
+        ident = ll_thread.c_thread_start_NOGIL(llcallback)
+        if ident == -1:
+            fatalerror("cannot start thread")
     else:
-        thread.start_new_thread(callback, args)
+        thread.start_new_thread(callback, ())