2 * Common qemu-thread implementation header file.
4 * Copyright Red Hat, Inc. 2018
7 * Peter Xu <peterx@redhat.com>,
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
13 #ifndef QEMU_THREAD_COMMON_H
14 #define QEMU_THREAD_COMMON_H
16 #include "qemu/thread.h"
19 static inline void qemu_mutex_post_init(QemuMutex *mutex)
21 #ifdef CONFIG_DEBUG_MUTEX
25 mutex->initialized = true;
28 static inline void qemu_mutex_pre_lock(QemuMutex *mutex,
29 const char *file, int line)
31 trace_qemu_mutex_lock(mutex, file, line);
34 static inline void qemu_mutex_post_lock(QemuMutex *mutex,
35 const char *file, int line)
37 #ifdef CONFIG_DEBUG_MUTEX
41 trace_qemu_mutex_locked(mutex, file, line);
44 static inline void qemu_mutex_pre_unlock(QemuMutex *mutex,
45 const char *file, int line)
47 #ifdef CONFIG_DEBUG_MUTEX
51 trace_qemu_mutex_unlock(mutex, file, line);