[project @ 2001-10-27 22:05:48 by sof]
authorsof <unknown>
Sat, 27 Oct 2001 22:05:48 +0000 (22:05 +0000)
committersof <unknown>
Sat, 27 Oct 2001 22:05:48 +0000 (22:05 +0000)
Added Show instance for Concurrent.ThreadId; useful when
debugging/diagnosing.

ghc/includes/PrimOps.h
ghc/rts/Schedule.c

index 0100f49..ed65437 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: PrimOps.h,v 1.83 2001/09/24 00:22:59 ken Exp $
+ * $Id: PrimOps.h,v 1.84 2001/10/27 22:05:48 sof Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
@@ -792,6 +792,7 @@ EXTFUN_RTS(unblockAsyncExceptionszh_fast);
 #define myThreadIdzh(t) (t = CurrentTSO)
 
 extern int cmp_thread(const StgTSO *tso1, const StgTSO *tso2);
+extern int rts_getThreadId(const StgTSO *tso);
 
 /* ------------------------------------------------------------------------
    Parallel PrimOps
index b2fb90a..de43f63 100644 (file)
@@ -1,5 +1,5 @@
 /* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.102 2001/10/23 11:28:51 simonmar Exp $
+ * $Id: Schedule.c,v 1.103 2001/10/27 22:05:48 sof Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
@@ -1399,6 +1399,16 @@ int cmp_thread(const StgTSO *tso1, const StgTSO *tso2)
 }
 
 /* ---------------------------------------------------------------------------
+ * Fetching the ThreadID from an StgTSO.
+ *
+ * This is used in the implementation of Show for ThreadIds.
+ * ------------------------------------------------------------------------ */
+int rts_getThreadId(const StgTSO *tso) 
+{
+  return tso->id;
+}
+
+/* ---------------------------------------------------------------------------
    Create a new thread.
 
    The new thread starts with the given stack size.  Before the