summaryrefslogtreecommitdiff
path: root/mysys/my_winthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/my_winthread.c')
-rw-r--r--mysys/my_winthread.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c
index 6b7a51e7755..aecb2f7cc78 100644
--- a/mysys/my_winthread.c
+++ b/mysys/my_winthread.c
@@ -129,6 +129,24 @@ error_return:
return -1;
}
+int pthread_cancel(pthread_t thread)
+{
+
+ HANDLE handle= 0;
+ BOOL ok= FALSE;
+
+ handle= OpenThread(THREAD_TERMINATE, FALSE, thread);
+ if (handle)
+ {
+ ok= TerminateThread(handle,0);
+ CloseHandle(handle);
+ }
+ if (ok)
+ return 0;
+
+ errno= EINVAL;
+ return -1;
+}
/*
One time initialization. For simplicity, we assume initializer thread
@@ -160,5 +178,4 @@ int my_pthread_once(my_pthread_once_t *once_control,
}
return 0;
}
-
#endif