]>
Commit | Line | Data |
---|---|---|
f1aff7aa PX |
1 | /* |
2 | * Common qemu-thread implementation header file. | |
3 | * | |
4 | * Copyright Red Hat, Inc. 2018 | |
5 | * | |
6 | * Authors: | |
7 | * Peter Xu <peterx@redhat.com>, | |
8 | * | |
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. | |
11 | */ | |
12 | ||
13 | #ifndef QEMU_THREAD_COMMON_H | |
14 | #define QEMU_THREAD_COMMON_H | |
15 | ||
16 | #include "qemu/typedefs.h" | |
17 | #include "qemu/thread.h" | |
18 | #include "trace.h" | |
19 | ||
20 | static inline void qemu_mutex_post_init(QemuMutex *mutex) | |
21 | { | |
22 | mutex->initialized = true; | |
23 | } | |
24 | ||
25 | static inline void qemu_mutex_pre_lock(QemuMutex *mutex, | |
26 | const char *file, int line) | |
27 | { | |
28 | trace_qemu_mutex_lock(mutex, file, line); | |
29 | } | |
30 | ||
31 | static inline void qemu_mutex_post_lock(QemuMutex *mutex, | |
32 | const char *file, int line) | |
33 | { | |
34 | trace_qemu_mutex_locked(mutex, file, line); | |
35 | } | |
36 | ||
37 | static inline void qemu_mutex_pre_unlock(QemuMutex *mutex, | |
38 | const char *file, int line) | |
39 | { | |
40 | trace_qemu_mutex_unlock(mutex, file, line); | |
41 | } | |
42 | ||
43 | #endif |