summaryrefslogtreecommitdiffstats
path: root/qemu-thread-posix.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix semaphores fallback codeBrad Smith2012-12-291-0/+1
| | | | | | | | | | | | | As reported in bug 1087114 the semaphores fallback code is broken which results 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> Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Disable semaphores fallback code for OpenBSDBrad Smith2012-12-281-5/+5
| | | | | | | | Disable the semaphores fallback code for OpenBSD as modern OpenBSD releases 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/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* semaphore: implement fallback counting semaphores with mutex+condvarPaolo Bonzini2012-11-021-10/+82
| | | | | | | | OpenBSD and Darwin do not have sem_timedwait. Implement a fallback for them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu-thread: add QemuSemaphorePaolo Bonzini2012-10-311-0/+80
| | | | | | | | The new thread pool will use semaphores instead of condition variables, because QemuCond does not have qemu_cond_timedwait. (I also like it more this way). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-thread: Let qemu_thread_is_self() return boolAndreas Färber2012-08-021-1/+1
| | | | | | | | qemu_cpu_is_self(), passing the return value through, will later be adapted to return bool as well. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Stefan Weil <sw@weilnetz.de>
* qemu-thread: implement joinable threads for POSIXJan Kiszka2011-12-121-2/+26
| | | | | | | | | | | | | | Allow to control if a QEMU thread is created joinable or not. Make it not joinable by default to avoid that we keep the associated resources around when terminating a thread without joining it (what we couldn't do so far for obvious reasons). The audio subsystem will need the join feature when converting it to QEMU threading/locking abstractions, so provide that service. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu-thread: add API for joinable threadsJan Kiszka2011-12-121-3/+4
| | | | | | | | | | Split from Jan's original qemu-thread-posix.c patch. No semantic change, just introduce the new API that POSIX and Win32 implementations will conform to. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Abort on thread layer errorsJan Kiszka2011-09-211-1/+1
| | | | | | | | Makes it easier to catch the bug in gdb as there is no need to set an explicit breakpoint. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* qemu-thread: delete unused functionsBlue Swirl2011-03-191-38/+0
| | | | | | | | | 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 servicePaolo Bonzini2011-03-131-9/+0
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* add assertions on the owner of a QemuMutexPaolo Bonzini2011-03-131-1/+5
| | | | | | | | | These are already present in the Win32 implementation, add them to the pthread wrappers as well. Use PTHREAD_MUTEX_ERRORCHECK for mutex operations. Later we'll add tracking of the owner for cond_signal/broadcast. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* add win32 qemu-thread implementationPaolo Bonzini2011-03-131-0/+192
For now, qemu_cond_timedwait and qemu_mutex_timedlock are left as POSIX-only functions. They can be removed later, once the patches that remove their uses are in. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud