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.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c
index 9e8458b0799..35715832fc6 100644
--- a/mysys/my_winthread.c
+++ b/mysys/my_winthread.c
@@ -129,4 +129,22 @@ 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;
+}
#endif