// QMutex::unlock() -- _ZN6QMutex6unlockEv
QT4CORE_FUNC(void, _ZN6QMutex6unlockEv,
             void* mutex)
{
   int    ret;
   OrigFn fn;
   VALGRIND_GET_ORIG_FN(fn);
   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PRE_MUTEX_UNLOCK,
                                   mutex, mutex_type(mutex), 0, 0, 0);
   CALL_FN_W_W(ret, fn, mutex);
   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__POST_MUTEX_UNLOCK,
                                   mutex, 0, 0, 0, 0);
}
// QMutex::~QMutex() -- _ZN6QMutexD2Ev
QT4CORE_FUNC(void, _ZN6QMutexD2Ev,
             void** 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);
   CALL_FN_W_W(ret, fn, mutex);
   VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_DESTROY,
                              mutex, mutex_type(mutex), 0, 0, 0);
}
// QMutex::tryLock() -- _ZN6QMutex7tryLockEv
QT4CORE_FUNC(int, _ZN6QMutex7tryLockEv,
             void* mutex)
{
   int    ret;
   OrigFn fn;
   VALGRIND_GET_ORIG_FN(fn);
   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PRE_MUTEX_LOCK,
                                   mutex, mutex_type(mutex), 1, 0, 0);
   CALL_FN_W_W(ret, fn, mutex);
   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__POST_MUTEX_LOCK,
                                   mutex, ret, 0, 0, 0);
   return ret;
}
Beispiel #4
0
// pthread_mutex_trylock
PTH_FUNC(int, pthreadZumutexZutrylock, // pthread_mutex_trylock
         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, 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);
  return ret;
}
Beispiel #5
0
// pthread_mutex_destroy
PTH_FUNC(int, pthreadZumutexZudestroy,
         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);
  CALL_FN_W_W(ret, fn, mutex);
  VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_DESTROY,
                             mutex, mutex_type(mutex), 0, 0, 0);
  return ret;
}
// QMutex::tryLock(int) -- _ZN6QMutex7tryLockEi
QT4CORE_FUNC(int, _ZN6QMutex7tryLockEi,
             void* mutex,
             int timeout_ms)
{
   int    ret;
   int    res;
   OrigFn fn;
   VALGRIND_GET_ORIG_FN(fn);
   VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__PRE_MUTEX_LOCK,
                              mutex, mutex_type(mutex), 1, 0, 0);
   CALL_FN_W_WW(ret, fn, mutex, timeout_ms);
   VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_LOCK,
                              mutex, ret, 0, 0, 0);
   return ret;
}
Beispiel #7
0
// pthread_cond_wait
PTH_FUNC(int, pthreadZucondZuwaitZa, // pthread_cond_wait*
         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, 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);
  return ret;
}
Beispiel #8
0
// pthread_mutex_timedlock
PTH_FUNC(int, pthreadZumutexZutimedlock, // pthread_mutex_timedlock
         pthread_mutex_t *mutex,
         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, 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);
  return ret;
}
// pthread_cond_timedwait
PTH_FUNC(int, pthreadZucondZutimedwaitZa, // pthread_cond_timedwait*
         pthread_cond_t *cond,
         pthread_mutex_t *mutex,
         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, 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, ret == 0, 0, 0);
    return ret;
}