don't forget to deRefTSO() in tryWakeupThread()
[ghc-hetmet.git] / rts / Threads.c
index e8a835b..5723eac 100644 (file)
@@ -215,8 +215,9 @@ removeThreadFromDeQueue (Capability *cap,
    ------------------------------------------------------------------------- */
 
 void
-tryWakeupThread (Capability *cap, StgTSO *tso)
+tryWakeupThread (Capability *cap, StgTSO *tso_)
 {
+    StgTSO *tso = deRefTSO(tso_);
 
     traceEventThreadWakeup (cap, tso, tso->cap->no);
 
@@ -291,7 +292,7 @@ migrateThread (Capability *from, StgTSO *tso, Capability *to)
     traceEventMigrateThread (from, tso, to->no);
     // ThreadMigrating tells the target cap that it needs to be added to
     // the run queue when it receives the MSG_TRY_WAKEUP.
-    tso->what_next = ThreadMigrating;
+    tso->why_blocked = ThreadMigrating;
     tso->cap = to;
     tryWakeupThread(from, tso);
 }