X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FSTM.h;fp=includes%2FSTM.h;h=3bf976551d71e8b950a2d3c1245453c591ff79ea;hb=9cef40bd4dd2536c7a370a1a9b78461c152805cc;hp=ebbf193b0b661699b4a1d52689a62ce98b7d9958;hpb=87c36991c22f208623c96506c64c6c163361e45b;p=ghc-hetmet.git diff --git a/includes/STM.h b/includes/STM.h index ebbf193..3bf9765 100644 --- a/includes/STM.h +++ b/includes/STM.h @@ -66,14 +66,13 @@ extern StgTRecHeader *stmStartNestedTransaction(Capability *cap, StgTRecHeader * ); /* - * Exit the current transaction context, abandoning any read/write - * operations performed within it and removing the thread from any - * tvar wait queues if it was waitin. Note that if nested transactions - * are not fully supported then this may leave the enclosing - * transaction contexts doomed to abort. + * Roll back the current transatcion context. NB: if this is a nested tx + * then we merge its read set into its parents. This is because a change + * to that read set could change whether or not the tx should abort. */ extern void stmAbortTransaction(Capability *cap, StgTRecHeader *trec); +extern void stmFreeAbortedTRec(Capability *cap, StgTRecHeader *trec); /* * Ensure that a subsequent commit / validation will fail. We use this @@ -149,6 +148,18 @@ extern StgBool stmValidateNestOfTransactions(StgTRecHeader *trec); */ /* + * Fill in the trec's list of invariants that might be violated by the current + * transaction. + */ + +extern StgInvariantCheckQueue *stmGetInvariantsToCheck(Capability *cap, + StgTRecHeader *trec); + +extern void stmAddInvariantToCheck(Capability *cap, + StgTRecHeader *trec, + StgClosure *code); + +/* * Test whether the current transaction context is valid and, if so, * commit its memory accesses to the heap. stmCommitTransaction must * unblock any threads which are waiting on tvars that updates have @@ -218,7 +229,8 @@ extern void stmWriteTVar(Capability *cap, /* NULLs */ -#define END_STM_WAIT_QUEUE ((StgTVarWaitQueue *)(void *)&stg_END_STM_WAIT_QUEUE_closure) +#define END_STM_WATCH_QUEUE ((StgTVarWatchQueue *)(void *)&stg_END_STM_WATCH_QUEUE_closure) +#define END_INVARIANT_CHECK_QUEUE ((StgInvariantCheckQueue *)(void *)&stg_END_INVARIANT_CHECK_QUEUE_closure) #define END_STM_CHUNK_LIST ((StgTRecChunk *)(void *)&stg_END_STM_CHUNK_LIST_closure) #define NO_TREC ((StgTRecHeader *)(void *)&stg_NO_TREC_closure)