|
From: Bart V. A. <bar...@gm...> - 2006-08-26 12:53:39
|
Julian, you made the following comment regarding the Valgrind patch I
proposed:
> Mostly it looks ok; however I'd prefer to first stabilise drd itself
> and to get some more experience and understanding of what it can/can't
> do. Anyway, some questions:
>
> ------
>
> +/* pthread_t as handled internally in valgrind. */
> +typedef UInt PosixThreadId;
>
> Uh, is that a portable assumption, that a Posix thread id is a
> 32-bit int? Maybe better would be UWord.
The new comment I added in pub_tool_basics.h should clarify this:
Index: pub_tool_basics.h
===================================================================
--- pub_tool_basics.h (revision 6012)
+++ pub_tool_basics.h (working copy)
@@ -97,6 +97,15 @@
/* ThreadIds are simply indices into the VG_(threads)[] array. */
typedef UInt ThreadId;
+/* A PosixThreadId identifies uniquely a POSIX thread in the client. This
datatype must
+ be able to represent any client pthread_t value. The only operations
performed on
+ this datatype are copying and comparison (==). Note: the POSIX standard
specifies
+ that POSIX thread IDs may be implemented as a struct, and that these
must be
+ compared by calling pthread_equal(). Representing POSIX thread IDs by an
integer is
+ a shortcut that works (at least) on Linux.
+ */
+typedef UWord PosixThreadId;
+
/* An abstraction of syscall return values.
When .isError == False, val holds the return value.
When .isError == True, val holds the error code.
|