summaryrefslogtreecommitdiff
path: root/mysys/my_wincond.c
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-09-30 17:40:12 +0200
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-09-30 17:40:12 +0200
commit9cf8d12c855e9713c5d3a170249c7d67935b2209 (patch)
treed211859561c812cd30d4143ce8099b8dc9cbaedf /mysys/my_wincond.c
parent28015993235d3a1a56f08de5b86c4e1ef59d4723 (diff)
downloadmariadb-git-9cf8d12c855e9713c5d3a170249c7d67935b2209.tar.gz
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()
Diffstat (limited to 'mysys/my_wincond.c')
-rw-r--r--mysys/my_wincond.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index d1b07b61408..956d29a970b 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -16,12 +16,11 @@
/*****************************************************************************
** The following is a simple implementation of posix conditions
*****************************************************************************/
+#if defined(_WIN32)
#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
#include "mysys_priv.h"
-#if defined(THREAD) && defined(__WIN__)
#include <m_string.h>
-#undef getpid
#include <process.h>
#include <sys/timeb.h>