move usleep(1) to gc_thread_work() from any_work()
[ghc-hetmet.git] / rts / sm / GC.c
index 934c91f..fa58905 100644 (file)
@@ -11,7 +11,7 @@
  *
  * ---------------------------------------------------------------------------*/
 
-#include "PosixSource.h"
+// #include "PosixSource.h"
 #include "Rts.h"
 #include "RtsFlags.h"
 #include "RtsUtils.h"
@@ -51,6 +51,7 @@
 #include "Sparks.h"
 
 #include <string.h> // for memset()
+#include <unistd.h>
 
 /* -----------------------------------------------------------------------------
    Global variables
@@ -1057,6 +1058,7 @@ loop:
               gct->thread_index, r);
 
     while (gc_running_threads != 0) {
+        usleep(1);
        if (any_work()) {
            inc_running();
            goto loop;