summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEmilio G. Cota2016-06-08 20:55:20 +0200
committerRichard Henderson2016-06-12 00:59:34 +0200
commitccdb3c1fc8865cf9142235b00e3a8fe3246f2a59 (patch)
treeebeea9367c34903e86fea644c1d2d7f5c2f134ab /include
parentcompiler.h: add QEMU_ALIGNED() to enforce struct alignment (diff)
downloadqemu-ccdb3c1fc8865cf9142235b00e3a8fe3246f2a59.tar.gz
qemu-ccdb3c1fc8865cf9142235b00e3a8fe3246f2a59.tar.xz
qemu-ccdb3c1fc8865cf9142235b00e3a8fe3246f2a59.zip
seqlock: remove optional mutex
This option is unused; besides, it bloats the struct when not needed. Let's just let writers define their own locks elsewhere. Reviewed-by: Sergey Fedorov <sergey.fedorov@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Emilio G. Cota <cota@braap.org> Message-Id: <1465412133-3029-3-git-send-email-cota@braap.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'include')
-rw-r--r--include/qemu/seqlock.h10
1 files changed, 1 insertions, 9 deletions
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)