git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5778
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
static DWORD WINAPI wrapper_start_routine(void *s) {
xbt_os_thread_t t = (xbt_os_thread_t)s;
static DWORD WINAPI wrapper_start_routine(void *s) {
xbt_os_thread_t t = (xbt_os_thread_t)s;
if(!TlsSetValue(xbt_self_thread_key,t))
THROW0(system_error,(int)GetLastError(),"TlsSetValue of data describing the created thread failed");
if(!TlsSetValue(xbt_self_thread_key,t))
THROW0(system_error,(int)GetLastError(),"TlsSetValue of data describing the created thread failed");
- rv = (*(t->start_routine))(t->param);
+ rv = (DWORD*)((t->start_routine)(t->param));
}
CloseHandle(thread->handle);
}
CloseHandle(thread->handle);
+
+ if(thread->name)
+ free(thread->name);
+
Sleep(0);
}
void xbt_os_thread_cancel(xbt_os_thread_t t) {
Sleep(0);
}
void xbt_os_thread_cancel(xbt_os_thread_t t) {
+ if(!TerminateThread(t->handle,0))
+ THROW0(system_error,(int)GetLastError(), "TerminateThread failed");
}
/****** mutex related functions ******/
}
/****** mutex related functions ******/