Author: Michal Bendowski <mic...@bendowski.pl> Branch: jvm-improvements Changeset: r56515:053913e841c7 Date: 2012-07-31 17:50 +0200 http://bitbucket.org/pypy/pypy/changeset/053913e841c7/
Log: Native Java version of thread_get_ident -- just enough to compile ll_thread. diff --git a/pypy/module/thread/ll_thread.py b/pypy/module/thread/ll_thread.py --- a/pypy/module/thread/ll_thread.py +++ b/pypy/module/thread/ll_thread.py @@ -46,7 +46,8 @@ # 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) diff --git a/pypy/translator/jvm/src/pypy/PyPy.java b/pypy/translator/jvm/src/pypy/PyPy.java --- a/pypy/translator/jvm/src/pypy/PyPy.java +++ b/pypy/translator/jvm/src/pypy/PyPy.java @@ -287,6 +287,10 @@ return Double.longBitsToDouble(l); } + public long pypy__thread_get_ident() { + return Thread.currentThread().getId(); + } + public long pypy__float2longlong(double d) { return Double.doubleToRawLongBits(d); } _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit