int err;
WaitObjects *w = &wait_objects;
+ qemu_mutex_unlock_iothread();
ret = WaitForMultipleObjects(w->num, w->events, FALSE, *timeout);
+ qemu_mutex_lock_iothread();
if (WAIT_OBJECT_0 + 0 <= ret && ret <= WAIT_OBJECT_0 + w->num - 1) {
if (w->func[ret - WAIT_OBJECT_0])
w->func[ret - WAIT_OBJECT_0](w->opaque[ret - WAIT_OBJECT_0]);
/* Note: cpu_interrupt() is currently not SMP safe, so we force
QEMU to run on a single CPU */
HANDLE h;
- DWORD mask, smask;
+ DWORD_PTR mask, smask;
int i;
SetConsoleCtrlHandler(qemu_ctrl_handler, TRUE);
if (file == INVALID_HANDLE_VALUE) {
return -1;
}
- len = snprintf(buffer, sizeof(buffer), "%ld\n", (long)getpid());
+ len = snprintf(buffer, sizeof(buffer), FMT_pid "\n", getpid());
ret = WriteFileEx(file, (LPCVOID)buffer, (DWORD)len,
&overlap, NULL);
if (ret == 0) {
}
return 0;
}
+
+int qemu_get_thread_id(void)
+{
+ return GetCurrentThreadId();
+}