[PATCH RFC 1/2] qemu-thread: Enable the new timedwait to use DEBUG_MUTEX too

Peter Xu posted 2 patches 3 years, 4 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>
[PATCH RFC 1/2] qemu-thread: Enable the new timedwait to use DEBUG_MUTEX too
Posted by Peter Xu 3 years, 4 months ago
The new _timedwait() version of qemu cond/mutex doesn't trigger the
DEBUG_MUTEX paths; enable it too.

Cc: Yury Kotov <yury-kotov@yandex-team.ru>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 util/qemu-thread-posix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index ac1d56e673..5840f6e6f5 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -229,9 +229,9 @@ qemu_cond_timedwait_ts(QemuCond *cond, QemuMutex *mutex, struct timespec *ts,
     int err;
 
     assert(cond->initialized);
-    trace_qemu_mutex_unlock(mutex, file, line);
+    qemu_mutex_pre_unlock(mutex, file, line);
     err = pthread_cond_timedwait(&cond->cond, &mutex->lock, ts);
-    trace_qemu_mutex_locked(mutex, file, line);
+    qemu_mutex_post_lock(mutex, file, line);
     if (err && err != ETIMEDOUT) {
         error_exit(err, __func__);
     }
-- 
2.37.3