From 710d005740f6d7246cce99f6d10b4e86a6d4ae4f Mon Sep 17 00:00:00 2001 From: tharris Date: Mon, 21 Nov 2005 20:00:55 +0000 Subject: [PATCH] [project @ 2005-11-21 20:00:55 by tharris] Files missed from STM implementation changes --- ghc/includes/Closures.h | 6 +++--- ghc/includes/STM.h | 17 ++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ghc/includes/Closures.h b/ghc/includes/Closures.h index df3bca3..e8966d0 100644 --- a/ghc/includes/Closures.h +++ b/ghc/includes/Closures.h @@ -358,7 +358,7 @@ typedef struct { StgClosure *volatile current_value; StgTVarWaitQueue *volatile first_wait_queue_entry; #if defined(SMP) - struct StgTRecHeader_ *volatile last_update_by; + StgInt volatile num_updates; #endif } StgTVar; @@ -369,11 +369,11 @@ typedef struct { StgClosure *expected_value; StgClosure *new_value; #if defined(SMP) - struct StgTRecHeader_ *saw_update_by; + StgInt num_updates; #endif } TRecEntry; -#define TREC_CHUNK_NUM_ENTRIES 256 +#define TREC_CHUNK_NUM_ENTRIES 16 typedef struct StgTRecChunk_ { StgHeader header; diff --git a/ghc/includes/STM.h b/ghc/includes/STM.h index b74d2bb..3065ddc 100644 --- a/ghc/includes/STM.h +++ b/ghc/includes/STM.h @@ -46,13 +46,10 @@ extern "C" { /*---------------------------------------------------------------------- - Start of day - ------------ - + GC interaction + -------------- */ -extern void initSTM(void); - extern void stmPreGCHook(void); /*---------------------------------------------------------------------- @@ -76,7 +73,7 @@ extern StgTRecHeader *stmStartNestedTransaction(Capability *cap, StgTRecHeader * * transaction contexts doomed to abort. */ -extern void stmAbortTransaction(StgTRecHeader *trec); +extern void stmAbortTransaction(Capability *cap, StgTRecHeader *trec); /* * Ensure that a subsequent commit / validation will fail. We use this @@ -87,7 +84,7 @@ extern void stmAbortTransaction(StgTRecHeader *trec); * in case other threads' updates make it valid in the mean time. */ -extern void stmCondemnTransaction(StgTRecHeader *trec); +extern void stmCondemnTransaction(Capability *cap, StgTRecHeader *trec); /* * Return the trec within which the specified trec was created (not @@ -165,13 +162,15 @@ extern StgBool stmCommitNestedTransaction(Capability *cap, StgTRecHeader *trec); * Test whether the current transaction context is valid and, if so, * start the thread waiting for updates to any of the tvars it has * ready from and mark it as blocked. It is an error to call stmWait - * if the thread is already waiting. + * if the thread is already waiting. */ extern StgBool stmWait(Capability *cap, StgTSO *tso, StgTRecHeader *trec); +extern void stmWaitUnlock(Capability *cap, StgTRecHeader *trec); + /* * Test whether the current transaction context is valid and, if so, * leave the thread waiting and mark it as blocked again. If the @@ -180,7 +179,7 @@ extern StgBool stmWait(Capability *cap, * thread is not waiting. */ -extern StgBool stmReWait(StgTSO *tso); +extern StgBool stmReWait(Capability *cap, StgTSO *tso); /*---------------------------------------------------------------------- -- 1.7.10.4