]> git.proxmox.com Git - mirror_qemu.git/commit - util/qemu-coroutine-lock.c
coroutine-lock: add qemu_co_rwlock_downgrade and qemu_co_rwlock_upgrade
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 29 Jun 2017 13:27:40 +0000 (15:27 +0200)
committerFam Zheng <famz@redhat.com>
Mon, 17 Jul 2017 03:28:15 +0000 (11:28 +0800)
commit667221c10d05a22573dae1928880bca525f8cd20
treebb15947cc81b0073b1f4903b76036a2bf1306d9f
parenta8c57408cd5443186c5b1c7a393702b316d4722b
coroutine-lock: add qemu_co_rwlock_downgrade and qemu_co_rwlock_upgrade

These functions are more efficient in the presence of contention.
qemu_co_rwlock_downgrade also guarantees not to block, which may
be useful in some algorithms too.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20170629132749.997-3-pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
include/qemu/coroutine.h
util/qemu-coroutine-lock.c