|
From: <sv...@va...> - 2008-09-27 12:41:01
|
Author: bart
Date: 2008-09-27 13:40:57 +0100 (Sat, 27 Sep 2008)
New Revision: 8640
Log:
Added intercept for pthread_cancel().
Modified:
trunk/drd/drd_pthread_intercepts.c
Modified: trunk/drd/drd_pthread_intercepts.c
===================================================================
--- trunk/drd/drd_pthread_intercepts.c 2008-09-27 12:36:48 UTC (rev 8639)
+++ trunk/drd/drd_pthread_intercepts.c 2008-09-27 12:40:57 UTC (rev 8640)
@@ -126,7 +126,10 @@
return mutex_type_invalid_mutex;
}
-static MutexT mutex_type(pthread_mutex_t* mutex)
+/** @note The function mutex_type() has been declared inline in order
+ * to avoid that it shows up in call stacks.
+ */
+static __inline__ MutexT mutex_type(pthread_mutex_t* mutex)
{
#if defined(HAVE_PTHREAD_MUTEX_T__M_KIND)
/* LinuxThreads. */
@@ -344,6 +347,21 @@
return ret;
}
+// pthread_cancel
+PTH_FUNC(int, pthreadZucancel, pthread_t pt_thread)
+{
+ int res;
+ int ret;
+ OrigFn fn;
+ VALGRIND_GET_ORIG_FN(fn);
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_THREAD_CANCEL,
+ pt_thread, 0, 0, 0, 0);
+ CALL_FN_W_W(ret, fn, pt_thread);
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_THREAD_CANCEL,
+ pt_thread, ret==0, 0, 0, 0);
+ return ret;
+}
+
// pthread_mutex_init
PTH_FUNC(int, pthreadZumutexZuinit,
pthread_mutex_t *mutex,
|