summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-03-29 14:45:21 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-03-29 14:45:21 +0000
commit2726a2f10256710cc6ed80b1098cb32e121e1be7 (patch)
tree81eef196c77c6a7f4581547202e664f38cc70882 /includes
parent4b7fdaa8617e1fadc6175d2400d11fa1fc062c03 (diff)
downloadhaskell-2726a2f10256710cc6ed80b1098cb32e121e1be7.tar.gz
Move a thread to the front of the run queue when another thread blocks on it
This fixes #3838, and was made possible by the new BLACKHOLE infrastructure. To allow reording of the run queue I had to make it doubly-linked, which entails some extra trickiness with regard to GC write barriers and suchlike.
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/storage/TSO.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/includes/rts/storage/TSO.h b/includes/rts/storage/TSO.h
index e07be88ac5..abe621564d 100644
--- a/includes/rts/storage/TSO.h
+++ b/includes/rts/storage/TSO.h
@@ -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