move usleep(1) to gc_thread_work() from any_work()
authorSimon Marlow <simonmarhaskell@gmail.com>
Wed, 16 Apr 2008 21:53:25 +0000 (21:53 +0000)
committerSimon Marlow <simonmarhaskell@gmail.com>
Wed, 16 Apr 2008 21:53:25 +0000 (21:53 +0000)
rts/sm/GC.c
rts/sm/Scav.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;
index fc63a85..d8d158a 100644 (file)
@@ -11,8 +11,6 @@
  *
  * ---------------------------------------------------------------------------*/
 
-#include <unistd.h>
-
 #include "Rts.h"
 #include "RtsFlags.h"
 #include "Storage.h"
@@ -1575,7 +1573,6 @@ any_work (void)
     }
 
     gct->no_work++;
-    usleep(1);
 
     return rtsFalse;
 }