X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FTSO.h;h=c6ec6697d4c561d5bd414556115b76e33a64bdd5;hb=bb7ffa1642e2110e26e1243c42a8a24adafa985d;hp=088097ea507588a705b53f34606a26e03f69763f;hpb=911b42b27ad5f039465d14052460e2d9dde053ab;p=ghc-hetmet.git diff --git a/includes/TSO.h b/includes/TSO.h index 088097e..c6ec669 100644 --- a/includes/TSO.h +++ b/includes/TSO.h @@ -124,7 +124,21 @@ typedef union { typedef struct StgTSO_ { StgHeader header; - struct StgTSO_* link; /* Links threads onto blocking queues */ + /* The link field, for linking threads together in lists (e.g. the + run queue on a Capability. + */ + struct StgTSO_* _link; + /* + NOTE!!! do not modify _link directly, it is subject to + a write barrier for generational GC. Instead use the + setTSOLink() function. Exceptions to this rule are: + + * setting the link field to END_TSO_QUEUE + * putting a TSO on the blackhole_queue + * setting the link field of the currently running TSO, as it + will already be dirty. + */ + struct StgTSO_* global_link; /* Links all threads together */ StgWord16 what_next; /* Values defined in Constants.h */ @@ -172,6 +186,13 @@ typedef struct StgTSO_ { } StgTSO; /* ----------------------------------------------------------------------------- + functions + -------------------------------------------------------------------------- */ + +extern void dirty_TSO (Capability *cap, StgTSO *tso); +extern void setTSOLink (Capability *cap, StgTSO *tso, StgTSO *target); + +/* ----------------------------------------------------------------------------- Invariants: An active thread has the following properties: