Searched hist:"51 dee5e465e1b3454a886792ca3e14b851e8e67d" (Results 1 – 2 of 2) sorted by relevance
/openbmc/qemu/util/ |
H A D | lockcnt.c | 51dee5e465e1b3454a886792ca3e14b851e8e67d Thu Jan 12 12:07:52 CST 2017 Paolo Bonzini <pbonzini@redhat.com> 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 <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20170112180800.21085-3-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
/openbmc/qemu/include/qemu/ |
H A D | thread.h | diff 51dee5e465e1b3454a886792ca3e14b851e8e67d Thu Jan 12 12:07:52 CST 2017 Paolo Bonzini <pbonzini@redhat.com> 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 <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20170112180800.21085-3-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|