-/* -*- mode: C; c-basic-offset: 3; -*- */
+/* -*- mode: C; c-basic-offset: 3; indent-tabs-mode: nil; -*- */
/*--------------------------------------------------------------------*/
/*--- Client-space code for DRD. drd_pthread_intercepts.c ---*/
/*
This file is part of DRD, a thread error detector.
- Copyright (C) 2006-2010 Bart Van Assche <bart.vanassche@gmail.com>.
+ Copyright (C) 2006-2011 Bart Van Assche <bvanassche@acm.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include <assert.h> /* assert() */
#include <pthread.h> /* pthread_mutex_t */
#include <semaphore.h> /* sem_t */
+#include <stdint.h> /* uintptr_t */
#include <stdio.h> /* fprintf() */
#include <stdlib.h> /* malloc(), free() */
#include <unistd.h> /* confstr() */
#include "pub_tool_redir.h" /* VG_WRAP_FUNCTION_ZZ() */
-/* Defines. */
-
/*
- * Do not undefine the two macro's below, or the following two subtle race
- * conditions will be introduced in the data race detection algorithm:
- * - sg_init() runs on the context of the created thread and copies the
- * vector clock of the creator thread. This only works reliably if
- * the creator thread waits until this copy has been performed.
- * - Since DRD_(thread_compute_minimum_vc)() does not take the vector
- * clocks into account that are involved in thread creation but
- * for which the corresponding thread has not yet been created, by
- * undefining the macro below it becomes possible that segments get
- * discarded that should not yet be discarded. Or: some data races
- * are not detected.
+ * Notes regarding thread creation:
+ * - sg_init() runs on the context of the created thread and copies the vector
+ * clock of the creator thread. This only works reliably if the creator
+ * thread waits until this copy has been performed.
+ * - DRD_(thread_compute_minimum_vc)() does not take the vector clocks into
+ * account that are involved in thread creation and for which the
+ * corresponding thread has not yet been created. So not waiting until the
+ * created thread has been started would make it possible that segments get
+ * discarded that should not yet be discarded. Or: some data races are not
+ * detected.
*/
-#define WAIT_UNTIL_CREATED_THREAD_STARTED
-#define ALLOCATE_THREAD_ARGS_ON_THE_STACK
/**
* Macro for generating a Valgrind interception function.
* @param[in] arg_decl Argument declaration list enclosed in parentheses.
* @param[in] argl Argument list enclosed in parentheses.
*/
+#ifdef VGO_darwin
+static int never_true;
+#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
+ { \
+ ret_ty pth_func_result = implf argl; \
+ /* Apparently inserting a function call in wrapper functions */ \
+ /* is sufficient to avoid misaligned stack errors. */ \
+ if (never_true) \
+ fflush(stdout); \
+ return pth_func_result; \
+ }
+#else
#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
{ return implf argl; }
+#endif
/**
* Macro for generating three Valgrind interception functions: one with the
void* (*start)(void*);
void* arg;
int detachstate;
-#if defined(WAIT_UNTIL_CREATED_THREAD_STARTED)
int wrapper_started;
-#endif
} DrdPosixThreadArgs;
}
}
+#define IS_ALIGNED(p) (((uintptr_t)(p) & (sizeof(*(p)) - 1)) == 0)
+
/**
* Read the mutex type stored in the client memory used for the mutex
* implementation.
{
#if defined(HAVE_PTHREAD_MUTEX_T__M_KIND)
/* glibc + LinuxThreads. */
- const int kind = mutex->__m_kind & 3;
- return DRD_(pthread_to_drd_mutex_type)(kind);
+ if (IS_ALIGNED(&mutex->__m_kind))
+ {
+ const int kind = mutex->__m_kind & 3;
+ return DRD_(pthread_to_drd_mutex_type)(kind);
+ }
#elif defined(HAVE_PTHREAD_MUTEX_T__DATA__KIND)
/* glibc + NPTL. */
- const int kind = mutex->__data.__kind & 3;
- return DRD_(pthread_to_drd_mutex_type)(kind);
+ if (IS_ALIGNED(&mutex->__data.__kind))
+ {
+ const int kind = mutex->__data.__kind & 3;
+ return DRD_(pthread_to_drd_mutex_type)(kind);
+ }
#else
/*
* Another POSIX threads implementation. The mutex type won't be printed
* when enabling --trace-mutex=yes.
*/
- return mutex_type_unknown;
#endif
+ return mutex_type_unknown;
}
/**
*/
static void DRD_(set_joinable)(const pthread_t tid, const int joinable)
{
- int res;
assert(joinable == 0 || joinable == 1);
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__SET_JOINABLE,
- tid, joinable, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__SET_JOINABLE,
+ tid, joinable, 0, 0, 0);
}
/** Tell DRD that the calling thread is about to enter pthread_create(). */
static __always_inline void DRD_(entering_pthread_create)(void)
{
- int res;
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__ENTERING_PTHREAD_CREATE,
- 0, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__ENTERING_PTHREAD_CREATE,
+ 0, 0, 0, 0, 0);
}
/** Tell DRD that the calling thread has left pthread_create(). */
static __always_inline void DRD_(left_pthread_create)(void)
{
- int res;
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__LEFT_PTHREAD_CREATE,
- 0, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__LEFT_PTHREAD_CREATE,
+ 0, 0, 0, 0, 0);
}
/**
*/
static void* DRD_(thread_wrapper)(void* arg)
{
- int res;
DrdPosixThreadArgs* arg_ptr;
DrdPosixThreadArgs arg_copy;
arg_ptr = (DrdPosixThreadArgs*)arg;
arg_copy = *arg_ptr;
-#if defined(WAIT_UNTIL_CREATED_THREAD_STARTED)
- arg_ptr->wrapper_started = 1;
-#else
-#if defined(ALLOCATE_THREAD_ARGS_ON_THE_STACK)
-#error Defining ALLOCATE_THREAD_ARGS_ON_THE_STACK but not \
- WAIT_UNTIL_CREATED_THREAD_STARTED is not supported.
-#else
- free(arg_ptr);
-#endif
-#endif
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__SET_PTHREADID,
- pthread_self(), 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__SET_PTHREADID,
+ pthread_self(), 0, 0, 0, 0);
DRD_(set_joinable)(pthread_self(),
arg_copy.detachstate == PTHREAD_CREATE_JOINABLE);
+ /*
+ * Only set 'wrapper_started' after VG_USERREQ__SET_PTHREADID and
+ * DRD_(set_joinable)() have been invoked to avoid a race with
+ * a pthread_detach() invocation for this thread from another thread.
+ */
+ arg_ptr->wrapper_started = 1;
+
return (arg_copy.start)(arg_copy.arg);
}
*/
static void DRD_(set_main_thread_state)(void)
{
- int res;
-
// Make sure that DRD knows about the main thread's POSIX thread ID.
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__SET_PTHREADID,
- pthread_self(), 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__SET_PTHREADID,
+ pthread_self(), 0, 0, 0, 0);
}
/*
int pthread_create_intercept(pthread_t* thread, const pthread_attr_t* attr,
void* (*start)(void*), void* arg)
{
- int res;
int ret;
OrigFn fn;
-#if defined(ALLOCATE_THREAD_ARGS_ON_THE_STACK)
DrdPosixThreadArgs thread_args;
-#endif
- DrdPosixThreadArgs* thread_args_p;
VALGRIND_GET_ORIG_FN(fn);
-#if defined(ALLOCATE_THREAD_ARGS_ON_THE_STACK)
- thread_args_p = &thread_args;
-#else
- thread_args_p = malloc(sizeof(*thread_args_p));
-#endif
- assert(thread_args_p);
-
- thread_args_p->start = start;
- thread_args_p->arg = arg;
-#if defined(WAIT_UNTIL_CREATED_THREAD_STARTED)
- DRD_IGNORE_VAR(thread_args_p->wrapper_started);
- thread_args_p->wrapper_started = 0;
-#endif
+ thread_args.start = start;
+ thread_args.arg = arg;
+ DRD_IGNORE_VAR(thread_args.wrapper_started);
+ thread_args.wrapper_started = 0;
/*
* Find out whether the thread will be started as a joinable thread
* or as a detached thread. If no thread attributes have been specified,
* this means that the new thread will be started as a joinable thread.
*/
- thread_args_p->detachstate = PTHREAD_CREATE_JOINABLE;
+ thread_args.detachstate = PTHREAD_CREATE_JOINABLE;
if (attr)
{
- if (pthread_attr_getdetachstate(attr, &thread_args_p->detachstate) != 0)
- {
+ if (pthread_attr_getdetachstate(attr, &thread_args.detachstate) != 0)
assert(0);
- }
}
- assert(thread_args_p->detachstate == PTHREAD_CREATE_JOINABLE
- || thread_args_p->detachstate == PTHREAD_CREATE_DETACHED);
-
+ assert(thread_args.detachstate == PTHREAD_CREATE_JOINABLE
+ || thread_args.detachstate == PTHREAD_CREATE_DETACHED);
DRD_(entering_pthread_create)();
- CALL_FN_W_WWWW(ret, fn, thread, attr, DRD_(thread_wrapper), thread_args_p);
+ CALL_FN_W_WWWW(ret, fn, thread, attr, DRD_(thread_wrapper), &thread_args);
DRD_(left_pthread_create)();
-#if defined(WAIT_UNTIL_CREATED_THREAD_STARTED)
if (ret == 0)
{
- /*
- * Wait until the thread wrapper started.
- * @todo Find out why some regression tests fail if thread arguments are
- * passed via dynamically allocated memory and if the loop below is
- * removed.
- */
- while (! thread_args_p->wrapper_started)
- {
+ /* Wait until the thread wrapper started. */
+ while (!thread_args.wrapper_started)
sched_yield();
- }
}
-#if defined(ALLOCATE_THREAD_ARGS_DYNAMICALLY)
- free(thread_args_p);
-#endif
-
-#endif
-
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__DRD_START_NEW_SEGMENT,
- pthread_self(), 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__DRD_START_NEW_SEGMENT,
+ pthread_self(), 0, 0, 0, 0);
return ret;
}
int pthread_join_intercept(pthread_t pt_joinee, void **thread_return)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
CALL_FN_W_WW(ret, fn, pt_joinee, thread_return);
if (ret == 0)
{
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_THREAD_JOIN,
- pt_joinee, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_THREAD_JOIN,
+ pt_joinee, 0, 0, 0, 0);
}
return ret;
}
{
int ret;
OrigFn fn;
+
VALGRIND_GET_ORIG_FN(fn);
- {
- CALL_FN_W_W(ret, fn, pt_thread);
- if (ret == 0)
- {
- DRD_(set_joinable)(pt_thread, 0);
- }
- }
+ CALL_FN_W_W(ret, fn, pt_thread);
+ DRD_(set_joinable)(pt_thread, 0);
+
return ret;
}
static __always_inline
int pthread_cancel_intercept(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);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-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);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_THREAD_CANCEL,
+ pt_thread, ret==0, 0, 0, 0);
return ret;
}
const pthread_mutexattr_t* attr)
{
int ret;
- int res;
OrigFn fn;
int mt;
VALGRIND_GET_ORIG_FN(fn);
mt = PTHREAD_MUTEX_DEFAULT;
if (attr)
pthread_mutexattr_gettype(attr, &mt);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_INIT,
- mutex, DRD_(pthread_to_drd_mutex_type)(mt),
- 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_MUTEX_INIT,
+ mutex, DRD_(pthread_to_drd_mutex_type)(mt),
+ 0, 0, 0);
CALL_FN_W_WW(ret, fn, mutex, attr);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_INIT,
- mutex, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_MUTEX_INIT,
+ mutex, 0, 0, 0, 0);
return ret;
}
int pthread_mutex_destroy_intercept(pthread_mutex_t* mutex)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_DESTROY,
- mutex, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_MUTEX_DESTROY,
+ mutex, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, mutex);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_DESTROY,
- mutex, DRD_(mutex_type)(mutex), 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_MUTEX_DESTROY,
+ mutex, DRD_(mutex_type)(mutex), 0, 0, 0);
return ret;
}
int pthread_mutex_lock_intercept(pthread_mutex_t* mutex)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
- mutex, DRD_(mutex_type)(mutex), 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__PRE_MUTEX_LOCK,
+ mutex, DRD_(mutex_type)(mutex), 0, 0, 0);
CALL_FN_W_W(ret, fn, mutex);
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__POST_MUTEX_LOCK,
- mutex, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__POST_MUTEX_LOCK,
+ mutex, ret == 0, 0, 0, 0);
return ret;
}
int pthread_mutex_trylock_intercept(pthread_mutex_t* mutex)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
- mutex, DRD_(mutex_type)(mutex), 1, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__PRE_MUTEX_LOCK,
+ mutex, DRD_(mutex_type)(mutex), 1, 0, 0);
CALL_FN_W_W(ret, fn, mutex);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_LOCK,
- mutex, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_MUTEX_LOCK,
+ mutex, ret == 0, 0, 0, 0);
return ret;
}
const struct timespec *abs_timeout)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
- mutex, DRD_(mutex_type)(mutex), 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__PRE_MUTEX_LOCK,
+ mutex, DRD_(mutex_type)(mutex), 0, 0, 0);
CALL_FN_W_WW(ret, fn, mutex, abs_timeout);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_LOCK,
- mutex, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_MUTEX_LOCK,
+ mutex, ret == 0, 0, 0, 0);
return ret;
}
int pthread_mutex_unlock_intercept(pthread_mutex_t *mutex)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1,
- VG_USERREQ__PRE_MUTEX_UNLOCK,
- mutex, DRD_(mutex_type)(mutex), 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_MUTEX_UNLOCK,
+ mutex, DRD_(mutex_type)(mutex), 0, 0, 0);
CALL_FN_W_W(ret, fn, mutex);
- VALGRIND_DO_CLIENT_REQUEST(res, -1,
- VG_USERREQ__POST_MUTEX_UNLOCK,
- mutex, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_MUTEX_UNLOCK,
+ mutex, 0, 0, 0, 0);
return ret;
}
const pthread_condattr_t* attr)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_INIT,
- cond, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_COND_INIT,
+ cond, 0, 0, 0, 0);
CALL_FN_W_WW(ret, fn, cond, attr);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_COND_INIT,
- cond, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_COND_INIT,
+ cond, 0, 0, 0, 0);
return ret;
}
int pthread_cond_destroy_intercept(pthread_cond_t* cond)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_DESTROY,
- cond, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_COND_DESTROY,
+ cond, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, cond);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_COND_DESTROY,
- cond, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_COND_DESTROY,
+ cond, 0, 0, 0, 0);
return ret;
}
int pthread_cond_wait_intercept(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_WAIT,
- cond, mutex, DRD_(mutex_type)(mutex), 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_COND_WAIT,
+ cond, mutex, DRD_(mutex_type)(mutex), 0, 0);
CALL_FN_W_WW(ret, fn, cond, mutex);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_COND_WAIT,
- cond, mutex, 1, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_COND_WAIT,
+ cond, mutex, 1, 0, 0);
return ret;
}
const struct timespec* abstime)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_WAIT,
- cond, mutex, DRD_(mutex_type)(mutex), 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_COND_WAIT,
+ cond, mutex, DRD_(mutex_type)(mutex), 0, 0);
CALL_FN_W_WWW(ret, fn, cond, mutex, abstime);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_COND_WAIT,
- cond, mutex, 1, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_COND_WAIT,
+ cond, mutex, 1, 0, 0);
return ret;
}
int pthread_cond_signal_intercept(pthread_cond_t* cond)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_SIGNAL,
- cond, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_COND_SIGNAL,
+ cond, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, cond);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_COND_SIGNAL,
- cond, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_COND_SIGNAL,
+ cond, 0, 0, 0, 0);
return ret;
}
int pthread_cond_broadcast_intercept(pthread_cond_t* cond)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_COND_BROADCAST,
- cond, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_COND_BROADCAST,
+ cond, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, cond);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_COND_BROADCAST,
- cond, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_COND_BROADCAST,
+ cond, 0, 0, 0, 0);
return ret;
}
int pthread_spin_init_intercept(pthread_spinlock_t *spinlock, int pshared)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SPIN_INIT_OR_UNLOCK,
- spinlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SPIN_INIT_OR_UNLOCK,
+ spinlock, 0, 0, 0, 0);
CALL_FN_W_WW(ret, fn, spinlock, pshared);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SPIN_INIT_OR_UNLOCK,
- spinlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SPIN_INIT_OR_UNLOCK,
+ spinlock, 0, 0, 0, 0);
return ret;
}
int pthread_spin_destroy_intercept(pthread_spinlock_t *spinlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_DESTROY,
- spinlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_MUTEX_DESTROY,
+ spinlock, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, spinlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_DESTROY,
- spinlock, mutex_type_spinlock, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_MUTEX_DESTROY,
+ spinlock, mutex_type_spinlock, 0, 0, 0);
return ret;
}
int pthread_spin_lock_intercept(pthread_spinlock_t *spinlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
- spinlock, mutex_type_spinlock, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__PRE_MUTEX_LOCK,
+ spinlock, mutex_type_spinlock, 0, 0, 0);
CALL_FN_W_W(ret, fn, spinlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_LOCK,
- spinlock, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_MUTEX_LOCK,
+ spinlock, ret == 0, 0, 0, 0);
return ret;
}
int pthread_spin_trylock_intercept(pthread_spinlock_t *spinlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
- spinlock, mutex_type_spinlock, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__PRE_MUTEX_LOCK,
+ spinlock, mutex_type_spinlock, 0, 0, 0);
CALL_FN_W_W(ret, fn, spinlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_LOCK,
- spinlock, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_MUTEX_LOCK,
+ spinlock, ret == 0, 0, 0, 0);
return ret;
}
int pthread_spin_unlock_intercept(pthread_spinlock_t *spinlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SPIN_INIT_OR_UNLOCK,
- spinlock, mutex_type_spinlock, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SPIN_INIT_OR_UNLOCK,
+ spinlock, mutex_type_spinlock, 0, 0, 0);
CALL_FN_W_W(ret, fn, spinlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SPIN_INIT_OR_UNLOCK,
- spinlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SPIN_INIT_OR_UNLOCK,
+ spinlock, 0, 0, 0, 0);
return ret;
}
unsigned count)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_BARRIER_INIT,
- barrier, pthread_barrier, count, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_BARRIER_INIT,
+ barrier, pthread_barrier, count, 0, 0);
CALL_FN_W_WWW(ret, fn, barrier, attr, count);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_BARRIER_INIT,
- barrier, pthread_barrier, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_BARRIER_INIT,
+ barrier, pthread_barrier, 0, 0, 0);
return ret;
}
int pthread_barrier_destroy_intercept(pthread_barrier_t* barrier)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_BARRIER_DESTROY,
- barrier, pthread_barrier, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_BARRIER_DESTROY,
+ barrier, pthread_barrier, 0, 0, 0);
CALL_FN_W_W(ret, fn, barrier);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_BARRIER_DESTROY,
- barrier, pthread_barrier, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_BARRIER_DESTROY,
+ barrier, pthread_barrier, 0, 0, 0);
return ret;
}
int pthread_barrier_wait_intercept(pthread_barrier_t* barrier)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_BARRIER_WAIT,
- barrier, pthread_barrier, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_BARRIER_WAIT,
+ barrier, pthread_barrier, 0, 0, 0);
CALL_FN_W_W(ret, fn, barrier);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_BARRIER_WAIT,
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_BARRIER_WAIT,
barrier, pthread_barrier,
ret == 0 || ret == PTHREAD_BARRIER_SERIAL_THREAD,
ret == PTHREAD_BARRIER_SERIAL_THREAD, 0);
int sem_init_intercept(sem_t *sem, int pshared, unsigned int value)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_INIT,
- sem, pshared, value, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SEM_INIT,
+ sem, pshared, value, 0, 0);
CALL_FN_W_WWW(ret, fn, sem, pshared, value);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SEM_INIT,
- sem, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SEM_INIT,
+ sem, 0, 0, 0, 0);
return ret;
}
int sem_destroy_intercept(sem_t *sem)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_DESTROY,
- sem, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SEM_DESTROY,
+ sem, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, sem);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SEM_DESTROY,
- sem, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SEM_DESTROY,
+ sem, 0, 0, 0, 0);
return ret;
}
unsigned int value)
{
sem_t *ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_OPEN,
- name, oflag, mode, value, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SEM_OPEN,
+ name, oflag, mode, value, 0);
CALL_FN_W_WWWW(ret, fn, name, oflag, mode, value);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SEM_OPEN,
- ret != SEM_FAILED ? ret : 0,
- name, oflag, mode, value);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SEM_OPEN,
+ ret != SEM_FAILED ? ret : 0,
+ name, oflag, mode, value);
return ret;
}
static __always_inline int sem_close_intercept(sem_t *sem)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_CLOSE,
- sem, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SEM_CLOSE,
+ sem, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, sem);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SEM_CLOSE,
- sem, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SEM_CLOSE,
+ sem, 0, 0, 0, 0);
return ret;
}
static __always_inline int sem_wait_intercept(sem_t *sem)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_WAIT,
- sem, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SEM_WAIT,
+ sem, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, sem);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SEM_WAIT,
- sem, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SEM_WAIT,
+ sem, ret == 0, 0, 0, 0);
return ret;
}
static __always_inline int sem_trywait_intercept(sem_t *sem)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_WAIT,
- sem, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SEM_WAIT,
+ sem, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, sem);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SEM_WAIT,
- sem, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SEM_WAIT,
+ sem, ret == 0, 0, 0, 0);
return ret;
}
int sem_timedwait_intercept(sem_t *sem, const struct timespec *abs_timeout)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_WAIT,
- sem, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SEM_WAIT,
+ sem, 0, 0, 0, 0);
CALL_FN_W_WW(ret, fn, sem, abs_timeout);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SEM_WAIT,
- sem, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SEM_WAIT,
+ sem, ret == 0, 0, 0, 0);
return ret;
}
static __always_inline int sem_post_intercept(sem_t *sem)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_SEM_POST,
- sem, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_SEM_POST,
+ sem, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, sem);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_SEM_POST,
- sem, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_SEM_POST,
+ sem, ret == 0, 0, 0, 0);
return ret;
}
const pthread_rwlockattr_t* attr)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_INIT,
- rwlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_RWLOCK_INIT,
+ rwlock, 0, 0, 0, 0);
CALL_FN_W_WW(ret, fn, rwlock, attr);
return ret;
}
int pthread_rwlock_destroy_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
CALL_FN_W_W(ret, fn, rwlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_RWLOCK_DESTROY,
- rwlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_RWLOCK_DESTROY,
+ rwlock, 0, 0, 0, 0);
return ret;
}
int pthread_rwlock_rdlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_RDLOCK,
- rwlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_RWLOCK_RDLOCK,
+ rwlock, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, rwlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_RWLOCK_RDLOCK,
- rwlock, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_RWLOCK_RDLOCK,
+ rwlock, ret == 0, 0, 0, 0);
return ret;
}
int pthread_rwlock_wrlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_WRLOCK,
- rwlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_RWLOCK_WRLOCK,
+ rwlock, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, rwlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_RWLOCK_WRLOCK,
- rwlock, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_RWLOCK_WRLOCK,
+ rwlock, ret == 0, 0, 0, 0);
return ret;
}
int pthread_rwlock_timedrdlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_RDLOCK,
- rwlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_RWLOCK_RDLOCK,
+ rwlock, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, rwlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_RWLOCK_RDLOCK,
- rwlock, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_RWLOCK_RDLOCK,
+ rwlock, ret == 0, 0, 0, 0);
return ret;
}
int pthread_rwlock_timedwrlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_WRLOCK,
- rwlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_RWLOCK_WRLOCK,
+ rwlock, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, rwlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_RWLOCK_WRLOCK,
- rwlock, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_RWLOCK_WRLOCK,
+ rwlock, ret == 0, 0, 0, 0);
return ret;
}
int pthread_rwlock_tryrdlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_RDLOCK,
- rwlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_RWLOCK_RDLOCK,
+ rwlock, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, rwlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_RWLOCK_RDLOCK,
- rwlock, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_RWLOCK_RDLOCK,
+ rwlock, ret == 0, 0, 0, 0);
return ret;
}
int pthread_rwlock_trywrlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_WRLOCK,
- rwlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_RWLOCK_WRLOCK,
+ rwlock, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, rwlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_RWLOCK_WRLOCK,
- rwlock, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_RWLOCK_WRLOCK,
+ rwlock, ret == 0, 0, 0, 0);
return ret;
}
int pthread_rwlock_unlock_intercept(pthread_rwlock_t* rwlock)
{
int ret;
- int res;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_RWLOCK_UNLOCK,
- rwlock, 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__PRE_RWLOCK_UNLOCK,
+ rwlock, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, rwlock);
- VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_RWLOCK_UNLOCK,
- rwlock, ret == 0, 0, 0, 0);
+ VALGRIND_DO_CLIENT_REQUEST_EXPR(-1, VG_USERREQ__POST_RWLOCK_UNLOCK,
+ rwlock, ret == 0, 0, 0, 0);
return ret;
}