From 51dee5e465e1b3454a886792ca3e14b851e8e67d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 12 Jan 2017 19:07:52 +0100 Subject: qemu-thread: introduce QemuLockCnt A QemuLockCnt comprises a counter and a mutex, with primitives to increment and decrement the counter, and to take and release the mutex. It can be used to do lock-free visits to a data structure whenever mutexes would be too heavy-weight and the critical section is too long for RCU. This could be implemented simply by protecting the counter with the mutex, but QemuLockCnt is harder to misuse and more efficient. Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Message-id: 20170112180800.21085-3-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi --- util/Makefile.objs | 1 + 1 file changed, 1 insertion(+) (limited to 'util/Makefile.objs') diff --git a/util/Makefile.objs b/util/Makefile.objs index ad0f9c7fe4..c1f247d675 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -1,5 +1,6 @@ util-obj-y = osdep.o cutils.o unicode.o qemu-timer-common.o util-obj-y += bufferiszero.o +util-obj-y += lockcnt.o util-obj-$(CONFIG_POSIX) += compatfd.o util-obj-$(CONFIG_POSIX) += event_notifier-posix.o util-obj-$(CONFIG_POSIX) += mmap-alloc.o -- cgit v1.2.3-55-g7522