aboutsummaryrefslogtreecommitdiff
path: root/util/qemu-thread-win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/qemu-thread-win32.c')
-rw-r--r--util/qemu-thread-win32.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c
index 94f3491..ab60c0d 100644
--- a/util/qemu-thread-win32.c
+++ b/util/qemu-thread-win32.c
@@ -56,30 +56,32 @@ void qemu_mutex_destroy(QemuMutex *mutex)
InitializeSRWLock(&mutex->lock);
}
-void qemu_mutex_lock(QemuMutex *mutex)
+void qemu_mutex_lock_impl(QemuMutex *mutex, const char *file, const int line)
{
assert(mutex->initialized);
+ trace_qemu_mutex_lock(mutex, file, line);
+
AcquireSRWLockExclusive(&mutex->lock);
- trace_qemu_mutex_locked(mutex);
+ trace_qemu_mutex_locked(mutex, file, line);
}
-int qemu_mutex_trylock(QemuMutex *mutex)
+int qemu_mutex_trylock_impl(QemuMutex *mutex, const char *file, const int line)
{
int owned;
assert(mutex->initialized);
owned = TryAcquireSRWLockExclusive(&mutex->lock);
if (owned) {
- trace_qemu_mutex_locked(mutex);
+ trace_qemu_mutex_locked(mutex, file, line);
return 0;
}
return -EBUSY;
}
-void qemu_mutex_unlock(QemuMutex *mutex)
+void qemu_mutex_unlock_impl(QemuMutex *mutex, const char *file, const int line)
{
assert(mutex->initialized);
- trace_qemu_mutex_unlocked(mutex);
+ trace_qemu_mutex_unlock(mutex, file, line);
ReleaseSRWLockExclusive(&mutex->lock);
}
@@ -140,12 +142,12 @@ void qemu_cond_broadcast(QemuCond *cond)
WakeAllConditionVariable(&cond->var);
}
-void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex)
+void qemu_cond_wait_impl(QemuCond *cond, QemuMutex *mutex, const char *file, const int line)
{
assert(cond->initialized);
- trace_qemu_mutex_unlocked(mutex);
+ trace_qemu_mutex_unlock(mutex, file, line);
SleepConditionVariableSRW(&cond->var, &mutex->lock, INFINITE, 0);
- trace_qemu_mutex_locked(mutex);
+ trace_qemu_mutex_locked(mutex, file, line);
}
void qemu_sem_init(QemuSemaphore *sem, int init)