qemu-thread: implement joinable threads for Win32

Rewrite the handshaking between qemu_thread_create and the
win32_start_routine, so that the thread can be joined without races.
Similar handshaking is done now between qemu_thread_exit and
qemu_thread_join.

This also simplifies how QemuThreads are initialized.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Paolo Bonzini 2011-12-12 17:21:33 +01:00 committed by Anthony Liguori
parent 8763046b4b
commit 403e633126
2 changed files with 71 additions and 39 deletions

View file

@ -13,9 +13,10 @@ struct QemuCond {
HANDLE continue_event;
};
typedef struct QemuThreadData QemuThreadData;
struct QemuThread {
HANDLE thread;
void *ret;
QemuThreadData *data;
unsigned tid;
};
#endif