[project @ 2005-11-04 12:02:04 by simonmar]
[ghc-hetmet.git] / ghc / rts / Schedule.c
index 6528fdd..d3851eb 100644 (file)
@@ -192,7 +192,7 @@ rtsBool shutting_down_scheduler = rtsFalse;
  * the THREADED_RTS and (inc. SMP) runtime.
  */
 #if defined(THREADED_RTS)
-Mutex sched_mutex = INIT_MUTEX_VAR;
+Mutex sched_mutex;
 #endif
 
 #if defined(PARALLEL_HASKELL)
@@ -779,7 +779,8 @@ schedulePushWork(Capability *cap USED_WHEN_SMP,
        for (; t != END_TSO_QUEUE; t = next) {
            next = t->link;
            t->link = END_TSO_QUEUE;
-           if (t->what_next == ThreadRelocated) {
+           if (t->what_next == ThreadRelocated
+               || t->bound == task) { // don't move my bound thread
                prev->link = t;
                prev = t;
            } else if (i == n_free_caps) {