fix some errors introduced by the last commit on qemu-thread-win32.c

This commit is contained in:
Nguyen Anh Quynh 2015-09-02 01:34:23 -07:00
parent 8b39ec5b0c
commit 2d9db36a2b

View file

@ -16,6 +16,8 @@
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>
#include "uc_priv.h"
static void error_exit(int err, const char *msg) static void error_exit(int err, const char *msg)
{ {
@ -264,6 +266,7 @@ struct QemuThreadData {
bool exited; bool exited;
void *ret; void *ret;
CRITICAL_SECTION cs; CRITICAL_SECTION cs;
struct uc_struct *uc;
}; };
static unsigned __stdcall win32_start_routine(void *arg) static unsigned __stdcall win32_start_routine(void *arg)
@ -276,7 +279,7 @@ static unsigned __stdcall win32_start_routine(void *arg)
g_free(data); g_free(data);
data = NULL; data = NULL;
} }
qemu_thread_exit(start_routine(thread_arg)); qemu_thread_exit(data->uc, start_routine(thread_arg));
abort(); abort();
} }
@ -335,6 +338,8 @@ void qemu_thread_create(struct uc_struct *uc, QemuThread *thread, const char *na
data->arg = arg; data->arg = arg;
data->mode = mode; data->mode = mode;
data->exited = false; data->exited = false;
data->uc = uc;
uc->qemu_thread_data = data; uc->qemu_thread_data = data;
if (data->mode != QEMU_THREAD_DETACHED) { if (data->mode != QEMU_THREAD_DETACHED) {