[project @ 2005-10-17 11:10:36 by simonpj]
[ghc-hetmet.git] / ghc / includes / Closures.h
index 39af80e..f9bfeb4 100644 (file)
@@ -189,11 +189,6 @@ typedef struct {
   StgHeader  header;
 } StgRetry;
 
-typedef struct _StgForeignObj {
-  StgHeader      header;
-  StgAddr        data;         /* pointer to data in non-haskell-land */
-} StgForeignObj;
-  
 typedef struct _StgStableName {
   StgHeader      header;
   StgWord        sn;
@@ -327,6 +322,7 @@ typedef struct {
   StgClosure*     value;
 } StgMVar;
 
+
 /* STM data structures
  *
  *  StgTVar defines the only type that can be updated through the STM
@@ -354,8 +350,11 @@ typedef struct StgTVarWaitQueue_ {
 
 typedef struct {
   StgHeader                  header;
-  StgClosure                *current_value;
-  StgTVarWaitQueue          *first_wait_queue_entry;
+  StgClosure                *volatile current_value;
+  StgTVarWaitQueue          *volatile first_wait_queue_entry;
+#if defined(SMP)
+  struct StgTRecHeader_     *volatile last_update_by;
+#endif
 } StgTVar;
 
 /* new_value == expected_value for read-only accesses */
@@ -364,6 +363,9 @@ typedef struct {
   StgTVar                   *tvar;
   StgClosure                *expected_value;
   StgClosure                *new_value; 
+#if defined(SMP)
+  struct StgTRecHeader_     *saw_update_by;
+#endif
 } TRecEntry;
 
 #define TREC_CHUNK_NUM_ENTRIES 256
@@ -377,8 +379,7 @@ typedef struct StgTRecChunk_ {
 
 typedef enum { 
   TREC_ACTIVE,        /* Transaction in progress, outcome undecided */
-  TREC_CANNOT_COMMIT, /* Transaction in progress, inconsistent writes performed */
-  TREC_MUST_ABORT,    /* Transaction in progress, inconsistent / out of date reads */
+  TREC_CONDEMNED,     /* Transaction in progress, inconsistent / out of date reads */
   TREC_COMMITTED,     /* Transaction has committed, now updating tvars */
   TREC_ABORTED,       /* Transaction has aborted, now reverting tvars */
   TREC_WAITING,       /* Transaction currently waiting */