check: Only test ioh3420 when it is compiled in
[qemu/ar7.git] / util / qemu-thread-common.h
bloba0ea7c0d9221199cd0f9639907812c4c41bfc47c
1 /*
2 * Common qemu-thread implementation header file.
4 * Copyright Red Hat, Inc. 2018
6 * Authors:
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/typedefs.h"
17 #include "qemu/thread.h"
18 #include "trace.h"
20 static inline void qemu_mutex_post_init(QemuMutex *mutex)
22 #ifdef CONFIG_DEBUG_MUTEX
23 mutex->file = NULL;
24 mutex->line = 0;
25 #endif
26 mutex->initialized = true;
29 static inline void qemu_mutex_pre_lock(QemuMutex *mutex,
30 const char *file, int line)
32 trace_qemu_mutex_lock(mutex, file, line);
35 static inline void qemu_mutex_post_lock(QemuMutex *mutex,
36 const char *file, int line)
38 #ifdef CONFIG_DEBUG_MUTEX
39 mutex->file = file;
40 mutex->line = line;
41 #endif
42 trace_qemu_mutex_locked(mutex, file, line);
45 static inline void qemu_mutex_pre_unlock(QemuMutex *mutex,
46 const char *file, int line)
48 #ifdef CONFIG_DEBUG_MUTEX
49 mutex->file = NULL;
50 mutex->line = 0;
51 #endif
52 trace_qemu_mutex_unlock(mutex, file, line);
55 #endif