From 8767eb6a0cf984a20b3725041efb64443af12979 Mon Sep 17 00:00:00 2001 From: navarrop Date: Tue, 18 Jan 2011 14:39:15 +0000 Subject: [PATCH] Windows compatibility. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9437 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/include/xbt/xbt_os_thread.h | 5 +++-- src/xbt/xbt_os_thread.c | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/include/xbt/xbt_os_thread.h b/src/include/xbt/xbt_os_thread.h index c88e733bcc..e4e07fc063 100644 --- a/src/include/xbt/xbt_os_thread.h +++ b/src/include/xbt/xbt_os_thread.h @@ -33,11 +33,12 @@ XBT_PUBLIC(int) xbt_os_thread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)); + XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_create(const char *name, - pvoid_f_pvoid_t - start_routine, + pvoid_f_pvoid_t start_routine, void *param, void *data); + XBT_PUBLIC(void) xbt_os_thread_exit(int *retcode); XBT_PUBLIC(void) xbt_os_thread_detach(xbt_os_thread_t thread); XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_self(void); diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index c3f56888b6..a04779da6a 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -620,6 +620,7 @@ typedef struct xbt_os_thread_ { unsigned long id; /* the win thread id */ pvoid_f_pvoid_t start_routine; void *param; + void *extra_data; } s_xbt_os_thread_t; /* so we can specify the size of the stack of the threads */ @@ -670,7 +671,8 @@ static DWORD WINAPI wrapper_start_routine(void *s) xbt_os_thread_t xbt_os_thread_create(const char *name, pvoid_f_pvoid_t start_routine, - void *param) + void *param, + void *extra_data) { xbt_os_thread_t t = xbt_new(s_xbt_os_thread_t, 1); @@ -678,7 +680,7 @@ xbt_os_thread_t xbt_os_thread_create(const char *name, t->name = xbt_strdup(name); t->start_routine = start_routine; t->param = param; - + t->extra_data = extra_data; t->handle = CreateThread(NULL, XBT_DEFAULT_THREAD_STACK_SIZE, (LPTHREAD_START_ROUTINE) wrapper_start_routine, t, STACK_SIZE_PARAM_IS_A_RESERVATION, &(t->id)); -- 2.20.1