[pypy-commit] pypy portable-threadlocal: one more

arigo noreply at buildbot.pypy.org
Sat Nov 22 22:44:55 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: portable-threadlocal
Changeset: r74643:ab0e68bc2ce0
Date: 2014-11-22 22:44 +0100
http://bitbucket.org/pypy/pypy/changeset/ab0e68bc2ce0/

Log:	one more

diff --git a/pypy/module/cpyext/src/pythread.c b/pypy/module/cpyext/src/pythread.c
--- a/pypy/module/cpyext/src/pythread.c
+++ b/pypy/module/cpyext/src/pythread.c
@@ -1,11 +1,18 @@
 #include <Python.h>
+#ifndef _WIN32
+# include <pthread.h>
+#endif
 #include "pythread.h"
 #include "src/thread.h"
 
 long
 PyThread_get_thread_ident(void)
 {
-    return RPyThreadGetIdent();
+#ifdef _WIN32
+    return (long)GetCurrentThreadId();
+#else
+    return (long)pthread_self();
+#endif
 }
 
 PyThread_type_lock


More information about the pypy-commit mailing list