[project @ 2006-01-06 16:30:17 by simonmar]
[ghc-hetmet.git] / ghc / includes / TSO.h
index 098ec4c..747c070 100644 (file)
@@ -85,7 +85,7 @@ typedef StgWord32 StgThreadID;
 typedef unsigned int StgThreadReturnCode;
 
 #if defined(mingw32_HOST_OS)
-/* results from an async I/O request + it's ID. */
+/* results from an async I/O request + its request ID. */
 typedef struct {
   unsigned int reqID;
   int          len;
@@ -98,7 +98,7 @@ typedef union {
   struct StgTSO_ *tso;
   StgInt fd;   /* StgInt instead of int, so that it's the same size as the ptrs */
 #if defined(mingw32_HOST_OS)
-  StgAsyncIOResult* async_result;
+  StgAsyncIOResult *async_result;
 #endif
   StgWord target;
 } StgTSOBlockInfo;
@@ -133,7 +133,7 @@ typedef struct StgTSO_ {
   struct StgTSO_*    blocked_exceptions;
   StgThreadID        id;
   int                saved_errno;
-  struct StgMainThread_* main;
+  struct Task_*      bound;          // non-NULL for a bound thread
   struct StgTRecHeader_ *trec;       /* STM transaction record */
   
 #ifdef TICKY_TICKY
@@ -240,7 +240,11 @@ extern StgTSO dummy_tso;
 
 
 /* this is the NIL ptr for a TSO queue (e.g. runnable queue) */
+#if IN_STG_CODE
+#define END_TSO_QUEUE  (stg_END_TSO_QUEUE_closure)
+#else
 #define END_TSO_QUEUE  ((StgTSO *)(void*)&stg_END_TSO_QUEUE_closure)
+#endif
 
 #if defined(PAR) || defined(GRAN)
 /* this is the NIL ptr for a blocking queue */