|
From: Tom H. <th...@cy...> - 2003-12-01 14:16:18
|
In message <200...@of...>
Nicholas Nethercote <nj...@ca...> wrote:
> +PRE(gettid)
> +{
> + /* pid_t gettid(void); */
> + MAYBE_PRINTF("gettid ()\n");
> +}
That may stop valgrind complaining, but it doesn't really do what
anybody expects as it will return the same value in all threads. In
particular a signal sent to the returned value will not go to the
right thread.
The way I've done it in my NPTL patch, which is just about complete
now, is to mark it as a blocking system call so that it is executed
in the proxy LWP which means that it will get a unique ID for each
thread, and that signals sent to that ID will get routed to the right
thread in valgrind.
Jeremy wasn't entirely sure that my solution was a good idea, or even
that it was worth trying to implement it at all at the moment. He had
some concerns about people managing to kill a proxy LWP with nasty
consequences.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|