const Bool took_lock)
{
cond_post_wait(cond);
- mutex_post_lock(mutex, took_lock);
+ mutex_post_lock(mutex, took_lock, True);
}
static void drd_pre_cond_signal(const Addr cond)
if (s_trace_cond)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_init 0x%lx",
+ "[%d/%d] cond_init cond 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
cond);
if (s_trace_cond)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_destroy 0x%lx",
+ "[%d/%d] cond_destroy cond 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
cond);
if (s_trace_cond)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_pre_wait 0x%lx",
+ "[%d/%d] cond_pre_wait cond 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
cond);
if (s_trace_cond)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_post_wait 0x%lx",
+ "[%d/%d] cond_post_wait cond 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
cond);
if (s_trace_cond)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_signal 0x%lx",
+ "[%d/%d] cond_signal cond 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
cond);
if (s_trace_cond)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] cond_broadcast 0x%lx",
+ "[%d/%d] cond_broadcast cond 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
cond);
void drd_post_mutex_lock(const Addr mutex, const Bool took_lock)
{
- mutex_post_lock(mutex, took_lock);
+ mutex_post_lock(mutex, took_lock, False);
}
void drd_pre_mutex_unlock(const Addr mutex, const MutexT mutex_type)
* Note: this function must be called after pthread_mutex_lock() has been
* called, or a race condition is triggered !
*/
-void mutex_post_lock(const Addr mutex, const Bool took_lock)
+void mutex_post_lock(const Addr mutex, const Bool took_lock,
+ const Bool post_cond_wait)
{
const DrdThreadId drd_tid = thread_get_running_tid();
struct mutex_info* p;
if (s_trace_mutex)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] post_mutex_lock %s 0x%lx rc %d owner %d%s",
+ "[%d/%d] %s %s 0x%lx rc %d owner %d%s",
VG_(get_running_tid)(),
drd_tid,
+ post_cond_wait ? "cond_post_wait " : "post_mutex_lock",
p ? mutex_get_typename(p) : "(?)",
mutex,
p ? p->recursion_count : 0,
struct mutex_info* mutex_get(const Addr mutex);
void mutex_pre_lock(const Addr mutex, const MutexT mutex_type,
const Bool trylock);
-void mutex_post_lock(const Addr mutex, const Bool took_lock);
+void mutex_post_lock(const Addr mutex, const Bool took_lock,
+ const Bool post_cond_wait);
void mutex_unlock(const Addr mutex, const MutexT mutex_type);
const char* mutex_get_typename(struct mutex_info* const p);
const char* mutex_type_name(const MutexT mt);
if (s_trace_semaphore)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] semaphore_init 0x%lx",
+ "[%d/%d] semaphore_init 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
semaphore);
if (s_trace_semaphore)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] semaphore_destroy 0x%lx",
+ "[%d/%d] semaphore_destroy 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
semaphore);
if (s_trace_semaphore)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] semaphore_pre_wait 0x%lx",
+ "[%d/%d] semaphore_pre_wait 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
semaphore);
if (s_trace_semaphore)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] semaphore_post 0x%lx",
+ "[%d/%d] semaphore_post 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
semaphore);
---------------- pthread_cond_wait et al ----------------
[1/1] mutex_init error checking mutex 0x........
-[1/1] cond_init 0x........
+[1/1] cond_init cond 0x........
[1/1] mutex_unlock error checking mutex 0x........ rc 0
Mutex not locked: mutex 0x........, recursion count 0, owner 0.
at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
by 0x........: main (tc20_verifywrap.c:147)
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 0
-[1/1] cond_signal 0x........
+[1/1] cond_pre_wait cond 0x........
+[1/1] cond_post_wait cond 0x........
+[1/1] cond_post_wait error checking mutex 0x........ rc 0 owner 0
+[1/1] cond_signal cond 0x........
FIXME: can't figure out how to verify wrap of pthread_cond_signal
-[1/1] cond_broadcast 0x........
+[1/1] cond_broadcast cond 0x........
FIXME: can't figure out how to verify wrap of pthread_broadcast_signal
[1/1] mutex_unlock error checking mutex 0x........ rc 1
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 1
+[1/1] cond_pre_wait cond 0x........
+[1/1] cond_post_wait cond 0x........
+[1/1] cond_post_wait error checking mutex 0x........ rc 0 owner 1
---------------- pthread_rwlock_* ----------------
---------------- sem_* ----------------
-[1/1] semaphore_init 0x........
-[1/1] semaphore_init 0x........
+[1/1] semaphore_init 0x........
+[1/1] semaphore_init 0x........
FIXME: can't figure out how to verify wrap of sem_destroy
-[1/1] semaphore_pre_wait 0x........
+[1/1] semaphore_pre_wait 0x........
[1/1] semaphore_post_wait 0x........
Invalid semaphore: semaphore 0x........
at 0x........: sem_wait* (drd_pthread_intercepts.c:?)
by 0x........: main (tc20_verifywrap.c:242)
-[1/1] semaphore_post 0x........
+[1/1] semaphore_post 0x........
FIXME: can't figure out how to verify wrap of sem_post
-[1/1] semaphore_destroy 0x........
+[1/1] semaphore_destroy 0x........
------------ dealloc of mem holding locks ------------
---------------- pthread_cond_wait et al ----------------
[1/1] mutex_init error checking mutex 0x........
-[1/1] cond_init 0x........
+[1/1] cond_init cond 0x........
[1/1] mutex_unlock error checking mutex 0x........ rc 0
Mutex not locked: mutex 0x........, recursion count 0, owner 0.
at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
by 0x........: main (tc20_verifywrap.c:147)
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 0
-[1/1] cond_signal 0x........
+[1/1] cond_pre_wait cond 0x........
+[1/1] cond_post_wait cond 0x........
+[1/1] cond_post_wait error checking mutex 0x........ rc 0 owner 0
+[1/1] cond_signal cond 0x........
FIXME: can't figure out how to verify wrap of pthread_cond_signal
-[1/1] cond_broadcast 0x........
+[1/1] cond_broadcast cond 0x........
FIXME: can't figure out how to verify wrap of pthread_broadcast_signal
[1/1] mutex_unlock error checking mutex 0x........ rc 1
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 1
+[1/1] cond_pre_wait cond 0x........
+[1/1] cond_post_wait cond 0x........
+[1/1] cond_post_wait error checking mutex 0x........ rc 0 owner 1
---------------- pthread_rwlock_* ----------------
---------------- sem_* ----------------
-[1/1] semaphore_init 0x........
-[1/1] semaphore_init 0x........
+[1/1] semaphore_init 0x........
+[1/1] semaphore_init 0x........
FIXME: can't figure out how to verify wrap of sem_destroy
-[1/1] semaphore_pre_wait 0x........
+[1/1] semaphore_pre_wait 0x........
[1/1] semaphore_post_wait 0x........
Invalid semaphore: semaphore 0x........
at 0x........: sem_wait* (drd_pthread_intercepts.c:?)
by 0x........: main (tc20_verifywrap.c:242)
-[1/1] semaphore_post 0x........
+[1/1] semaphore_post 0x........
FIXME: can't figure out how to verify wrap of sem_post
-[1/1] semaphore_destroy 0x........
+[1/1] semaphore_destroy 0x........
------------ dealloc of mem holding locks ------------
---------------- pthread_cond_wait et al ----------------
[1/1] mutex_init error checking mutex 0x........
-[1/1] cond_init 0x........
+[1/1] cond_init cond 0x........
[1/1] mutex_unlock error checking mutex 0x........ rc 0
Mutex not locked: mutex 0x........, recursion count 0, owner 0.
at 0x........: pthread_cond_wait* (drd_pthread_intercepts.c:?)
by 0x........: main (tc20_verifywrap.c:147)
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 0
-[1/1] cond_signal 0x........
+[1/1] cond_pre_wait cond 0x........
+[1/1] cond_post_wait cond 0x........
+[1/1] cond_post_wait error checking mutex 0x........ rc 0 owner 0
+[1/1] cond_signal cond 0x........
FIXME: can't figure out how to verify wrap of pthread_cond_signal
-[1/1] cond_broadcast 0x........
+[1/1] cond_broadcast cond 0x........
FIXME: can't figure out how to verify wrap of pthread_broadcast_signal
[1/1] mutex_unlock error checking mutex 0x........ rc 1
-[1/1] cond_pre_wait 0x........
-[1/1] cond_post_wait 0x........
-[1/1] post_mutex_lock error checking mutex 0x........ rc 0 owner 1
+[1/1] cond_pre_wait cond 0x........
+[1/1] cond_post_wait cond 0x........
+[1/1] cond_post_wait error checking mutex 0x........ rc 0 owner 1
---------------- pthread_rwlock_* ----------------
---------------- sem_* ----------------
-[1/1] semaphore_init 0x........
-[1/1] semaphore_init 0x........
+[1/1] semaphore_init 0x........
+[1/1] semaphore_init 0x........
FIXME: can't figure out how to verify wrap of sem_destroy
-[1/1] semaphore_pre_wait 0x........
+[1/1] semaphore_pre_wait 0x........
[1/1] semaphore_post_wait 0x........
Invalid semaphore: semaphore 0x........
at 0x........: sem_wait* (drd_pthread_intercepts.c:?)
by 0x........: main (tc20_verifywrap.c:242)
-[1/1] semaphore_post 0x........
+[1/1] semaphore_post 0x........
FIXME: can't figure out how to verify wrap of sem_post
-[1/1] semaphore_destroy 0x........
+[1/1] semaphore_destroy 0x........
------------ dealloc of mem holding locks ------------