[Qemu-devel] [PATCH 2/4] cpus: assert that the BQL is held in cpu_get_ticks

Emilio G. Cota posted 4 patches 7 years, 2 months ago
[Qemu-devel] [PATCH 2/4] cpus: assert that the BQL is held in cpu_get_ticks
Posted by Emilio G. Cota 7 years, 2 months ago
Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 cpus.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cpus.c b/cpus.c
index b5844b7103..b23bf6fef7 100644
--- a/cpus.c
+++ b/cpus.c
@@ -308,6 +308,8 @@ int64_t cpu_get_ticks(void)
 {
     int64_t ticks;
 
+    g_assert(qemu_mutex_iothread_locked());
+
     if (use_icount) {
         return cpu_get_icount();
     }
-- 
2.17.1