diff options
-rw-r--r-- | cpus.c | 2 | ||||
-rw-r--r-- | include/qemu/seqlock.h | 10 |
2 files changed, 2 insertions, 10 deletions
@@ -621,7 +621,7 @@ int cpu_throttle_get_percentage(void) void cpu_ticks_init(void) { - seqlock_init(&timers_state.vm_clock_seqlock, NULL); + seqlock_init(&timers_state.vm_clock_seqlock); vmstate_register(NULL, 0, &vmstate_timers, &timers_state); throttle_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT, cpu_throttle_timer_tick, NULL); diff --git a/include/qemu/seqlock.h b/include/qemu/seqlock.h index 70b01fd60d..e6734823ec 100644 --- a/include/qemu/seqlock.h +++ b/include/qemu/seqlock.h @@ -19,22 +19,17 @@ typedef struct QemuSeqLock QemuSeqLock; struct QemuSeqLock { - QemuMutex *mutex; unsigned sequence; }; -static inline void seqlock_init(QemuSeqLock *sl, QemuMutex *mutex) +static inline void seqlock_init(QemuSeqLock *sl) { - sl->mutex = mutex; sl->sequence = 0; } /* Lock out other writers and update the count. */ static inline void seqlock_write_lock(QemuSeqLock *sl) { - if (sl->mutex) { - qemu_mutex_lock(sl->mutex); - } ++sl->sequence; /* Write sequence before updating other fields. */ @@ -47,9 +42,6 @@ static inline void seqlock_write_unlock(QemuSeqLock *sl) smp_wmb(); ++sl->sequence; - if (sl->mutex) { - qemu_mutex_unlock(sl->mutex); - } } static inline unsigned seqlock_read_begin(QemuSeqLock *sl) |