Commits

Armin Rigo committed dda0292

Fixes

  • Participants
  • Parent commits d1696c4
  • Branches fast-gil

Comments (0)

Files changed (2)

File rpython/translator/c/src/thread.c

 /* 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

File rpython/translator/c/src/thread_pthread.c

     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) {
     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) {