From 14c2cfb568e081ef66e4b6aadfc9611dd0f4be88 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 30 Sep 2009 17:40:12 +0200 Subject: Backport of this changeset http://lists.mysql.com/commits/59686 Cleanup pthread_self(), pthread_create(), pthread_join() implementation on Windows. Prior implementation is was unnecessarily complicated and even differs in embedded and non-embedded case. Improvements in this patch: * pthread_t is now the unique thread ID, instead of HANDLE returned by beginthread This simplifies pthread_self() to be just straight GetCurrentThreadId(). prior it was much art involved in passing the beginthread() handle from the caller to the TLS structure in the child thread ( did not work for the main thread of course) * remove MySQL specific my_thread_init()/my_thread_end() from pthread_create. No automagic is done on Unix on pthread_create(). Having the same on Windows will improve portability and avoid extra #ifdef's * remove redefinition of getpid() - it was defined as GetCurrentThreadId() --- include/config-win.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/config-win.h') diff --git a/include/config-win.h b/include/config-win.h index bcad4e04346..514a762d6d8 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -27,6 +27,9 @@ #include #include #include +#include +#include /* getpid()*/ + #define HAVE_SMEM 1 -- cgit v1.2.1