From: Bart Van Assche Date: Sat, 1 Mar 2008 07:25:13 +0000 (+0000) Subject: When started with linuxthreads, the DRD tool now stops as soon as the first thread... X-Git-Tag: svn/VALGRIND_3_4_0~997 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43dbaec9203c4500b09068a310a02a4bc844515a;p=thirdparty%2Fvalgrind.git When started with linuxthreads, the DRD tool now stops as soon as the first thread is created. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7516 --- diff --git a/exp-drd/drd_intercepts.c b/exp-drd/drd_intercepts.c index 6e14d63923..fd2ee2b3fa 100644 --- a/exp-drd/drd_intercepts.c +++ b/exp-drd/drd_intercepts.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include "drd_clientreq.h" #include "pub_tool_redir.h" @@ -81,6 +82,7 @@ typedef struct // Local variables. static int vg_main_thread_state_is_set = 0; +static pid_t vg_main_thread_pid; // Function definitions. @@ -160,6 +162,17 @@ static void vg_set_joinable(const pthread_t tid, const int joinable) static void* vg_thread_wrapper(void* arg) { int res; + + if (getpid() != vg_main_thread_pid) + { + fprintf(stderr, + "Detected the linuxthreads threading library.\n" + "Sorry, but DRD does not support linuxthreads.\n" + "Please try to run DRD on a system with NPTL instead.\n" + "Giving up.\n"); + abort(); + } + VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__DRD_SUPPRESS_CURRENT_STACK, 0, 0, 0, 0, 0); @@ -189,6 +202,8 @@ static void vg_set_main_thread_state(void) { int res; + vg_main_thread_pid = getpid(); + VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__DRD_SUPPRESS_CURRENT_STACK, 0, 0, 0, 0, 0);