mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
coroutine-lock: make CoMutex thread-safe
This uses the lock-free mutex described in the paper '"Blocking without Locking", or LFTHREADS: A lock-free thread library' by Gidenstam and Papatriantafilou. The same technique is used in OSv, and in fact the code is essentially a conversion to C of OSv's code. [Added missing coroutine_fn in tests/test-aio-multithread.c. --Stefan] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 20170213181244.16297-2-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
91bcea4899
commit
fed20a70e3
4 changed files with 247 additions and 14 deletions
|
@ -28,6 +28,7 @@ qemu_coroutine_terminate(void *co) "self %p"
|
|||
|
||||
# util/qemu-coroutine-lock.c
|
||||
qemu_co_queue_run_restart(void *co) "co %p"
|
||||
qemu_co_mutex_lock_uncontended(void *mutex, void *self) "mutex %p self %p"
|
||||
qemu_co_mutex_lock_entry(void *mutex, void *self) "mutex %p self %p"
|
||||
qemu_co_mutex_lock_return(void *mutex, void *self) "mutex %p self %p"
|
||||
qemu_co_mutex_unlock_entry(void *mutex, void *self) "mutex %p self %p"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue