From 32df44aaa2e3f77eb9abd056b5ddce6a349acfb5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 13 Apr 2009 08:05:18 +0000 Subject: [PATCH] Make sure that DRD does not complain about mutexes being held too long on systems where the clock can go backward. Apparently this happens frequently when Linux is running inside a virtual machine. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9521 --- drd/drd_mutex.c | 2 +- drd/drd_rwlock.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drd/drd_mutex.c b/drd/drd_mutex.c index 98de75e76f..14977f61cb 100644 --- a/drd/drd_mutex.c +++ b/drd/drd_mutex.c @@ -405,7 +405,7 @@ void DRD_(mutex_unlock)(const Addr mutex, MutexT mutex_type) { if (s_mutex_lock_threshold_ms > 0) { - ULong held = VG_(read_millisecond_timer)() - p->acquiry_time_ms; + Long held = VG_(read_millisecond_timer)() - p->acquiry_time_ms; if (held > s_mutex_lock_threshold_ms) { HoldtimeErrInfo HEI diff --git a/drd/drd_rwlock.c b/drd/drd_rwlock.c index a2cfdaf1a0..82f28acb67 100644 --- a/drd/drd_rwlock.c +++ b/drd/drd_rwlock.c @@ -521,7 +521,7 @@ void DRD_(rwlock_pre_unlock)(const Addr rwlock) q->reader_nesting_count--; if (q->reader_nesting_count == 0 && DRD_(s_shared_threshold_ms) > 0) { - ULong held = VG_(read_millisecond_timer)() - p->acquiry_time_ms; + Long held = VG_(read_millisecond_timer)() - p->acquiry_time_ms; if (held > DRD_(s_shared_threshold_ms)) { HoldtimeErrInfo HEI @@ -539,7 +539,7 @@ void DRD_(rwlock_pre_unlock)(const Addr rwlock) q->writer_nesting_count--; if (q->writer_nesting_count == 0 && DRD_(s_exclusive_threshold_ms) > 0) { - ULong held = VG_(read_millisecond_timer)() - p->acquiry_time_ms; + Long held = VG_(read_millisecond_timer)() - p->acquiry_time_ms; if (held > DRD_(s_exclusive_threshold_ms)) { HoldtimeErrInfo HEI -- 2.47.3