History | View | Annotate | Download (6.8 kB)
Fix semaphores fallback code
As reported in bug 1087114 the semaphores fallback code is broken whichresults in QEMU crashing and making QEMU unusable.
This patch is from Paolo.
This needs to be back ported to the 1.3 stable tree as well.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
Disable semaphores fallback code for OpenBSD
Disable the semaphores fallback code for OpenBSD as modern OpenBSDreleases now have sem_timedwait().
Signed-off-by: Brad Smith <brad@comstyle.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
semaphore: implement fallback counting semaphores with mutex+condvar
OpenBSD and Darwin do not have sem_timedwait. Implement a fallbackfor them.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-thread: add QemuSemaphore
The new thread pool will use semaphores instead of conditionvariables, because QemuCond does not have qemu_cond_timedwait.(I also like it more this way).
qemu-thread: Let qemu_thread_is_self() return bool
qemu_cpu_is_self(), passing the return value through, will later beadapted to return bool as well.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Stefan Weil <sw@weilnetz.de>
qemu-thread: add API for joinable threads
Split from Jan's original qemu-thread-posix.c patch. No semantic change,just introduce the new API that POSIX and Win32 implementations willconform to.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qemu-thread: implement joinable threads for POSIX
Allow to control if a QEMU thread is created joinable or not. Make itnot joinable by default to avoid that we keep the associated resourcesaround when terminating a thread without joining it (what we couldn't do...
Abort on thread layer errors
Makes it easier to catch the bug in gdb as there is no need to set anexplicit breakpoint.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qemu-thread: delete unused functions
qemu_mutex_timedlock() and qemu_cond_timedwait() are no longer used.
Remove them and their helper timespec_add_ms().
Reported-by: François Revol <revol@free.fr>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
add Win32 IPI service
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
add win32 qemu-thread implementation
For now, qemu_cond_timedwait and qemu_mutex_timedlock are left asPOSIX-only functions. They can be removed later, once the patchesthat remove their uses are in.
add assertions on the owner of a QemuMutex
These are already present in the Win32 implementation, add them tothe pthread wrappers as well. Use PTHREAD_MUTEX_ERRORCHECK for mutexoperations. Later we'll add tracking of the owner for cond_signal/broadcast....