Move a thread to the front of the run queue when another thread blocks on it
[ghc-hetmet.git] / includes / rts / storage / TSO.h
index e07be88..abe6215 100644 (file)
@@ -46,6 +46,7 @@ typedef struct {
 /* Reason for thread being blocked. See comment above struct StgTso_. */
 typedef union {
   StgClosure *closure;
+  StgTSO *prev; // a back-link when the TSO is on the run queue (NotBlocked)
   struct MessageBlackHole_ *bh;
   struct MessageThrowTo_ *throwto;
   struct MessageWakeup_  *wakeup;
@@ -163,6 +164,7 @@ typedef struct StgTSO_ {
 
 void dirty_TSO  (Capability *cap, StgTSO *tso);
 void setTSOLink (Capability *cap, StgTSO *tso, StgTSO *target);
+void setTSOPrev (Capability *cap, StgTSO *tso, StgTSO *target);
 
 // Apply to a TSO before looking at it if you are not sure whether it
 // might be ThreadRelocated or not (basically, that's most of the time