[pypy-commit] pypy fast-gil: Fixes

arigo noreply at buildbot.pypy.org
Sun Mar 9 12:19:50 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: fast-gil
Changeset: r69822:dda0292acbfc
Date: 2014-03-09 12:19 +0100
http://bitbucket.org/pypy/pypy/changeset/dda0292acbfc/

Log:	Fixes

diff --git a/rpython/translator/c/src/thread.c b/rpython/translator/c/src/thread.c
--- a/rpython/translator/c/src/thread.c
+++ b/rpython/translator/c/src/thread.c
@@ -1,14 +1,23 @@
 /* Thread implementation */
 #include "src/thread.h"
 
-#ifdef PYPY_USING_BOEHM_GC
 /* The following include is required by the Boehm GC, which apparently
  * crashes when pthread_create_thread() is not redefined to call a
  * Boehm wrapper function instead.  Ugly.
+ *
+ * It is also needed to see the definition of RPY_FASTGIL, if there is one.
  */
 #include "common_header.h"
+
+/* More ugliness follows... */
+#ifdef RPY_FASTGIL
+# if RPY_FASTGIL == 42    /* special value to mean "asmgcc" */
+#  include "structdef.h"
+#  include "forwarddecl.h"
+# endif
 #endif
 
+
 #ifdef _WIN32
 #include "src/thread_nt.c"
 #else
diff --git a/rpython/translator/c/src/thread_pthread.c b/rpython/translator/c/src/thread_pthread.c
--- a/rpython/translator/c/src/thread_pthread.c
+++ b/rpython/translator/c/src/thread_pthread.c
@@ -598,10 +598,10 @@
     void *result;
 #if defined(__amd64__)
     asm volatile ("xchgq %0, %1  /* automatically locked */"
-                  : "r"(result) : "0"(value), "m"(*ptr) : "memory");
+                  : "=r"(result) : "0"(value), "m"(*ptr) : "memory");
 #elif defined(__i386__)
     asm volatile ("xchgl %0, %1  /* automatically locked */"
-                  : "r"(result) : "0"(value), "m"(*ptr) : "memory");
+                  : "=r"(result) : "0"(value), "m"(*ptr) : "memory");
 #else
     /* requires gcc >= 4.1 */
     while (1) {
@@ -646,7 +646,7 @@
     return 0;
 }
 
-static inline timespec_add(struct timespec *t, long incr)
+static inline void timespec_add(struct timespec *t, long incr)
 {
     long nsec = t->tv_nsec + incr;
     if (nsec >= 1000000000) {


More information about the pypy-commit mailing list