Commits

Michał Bendowski  committed 053913e

Native Java version of thread_get_ident -- just enough to compile ll_thread.

  • Participants
  • Parent commits a5f570e
  • Branches jvm-improvements

Comments (0)

Files changed (2)

File pypy/module/thread/ll_thread.py

                                               # importantly, reacquire it
                                               # around the callback
 c_thread_get_ident = llexternal('RPyThreadGetIdent', [], rffi.LONG,
-                                _nowrapper=True)    # always call directly
+                                _nowrapper=True,    # always call directly
+                                oo_primitive="pypy__thread_get_ident")
 
 TLOCKP = rffi.COpaquePtr('struct RPyOpaque_ThreadLock',
                           compilation_info=eci)

File pypy/translator/jvm/src/pypy/PyPy.java

         return Double.longBitsToDouble(l);
     }
 
+    public long pypy__thread_get_ident() {
+        return Thread.currentThread().getId();
+    }
+
     public long pypy__float2longlong(double d) {
         return Double.doubleToRawLongBits(d);
     }