summaryrefslogtreecommitdiff
path: root/include/my_pthread.h
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-06-25 19:21:18 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-06-25 19:21:18 +0300
commit76295d4bbe914cc990e4c01efc94e46db4fa2016 (patch)
tree652f299f83f82695c5cda6bbb45fc32388d00558 /include/my_pthread.h
parenta0fa27cf359397d721272635482a7d03687ad241 (diff)
downloadmariadb-git-76295d4bbe914cc990e4c01efc94e46db4fa2016.tar.gz
Bug #26564: Windows implementation of pthread_join crashes
MySQL uses _beginthread()/_endthread() instead of _beginthreadex()/_endthreadex() to create/end its threads on Windows. According to MSDN _endthread() does close the thread handle. So there's no need the handle to be closed explicitly. Besides : WaitForSingleObject(, INFINITE) != WAIT_OBJECT_0) is true for all practical cases as the other two possible return codes (according to MSDN) cannot happen in that case the CloseHandle() was actually a dead code. Fixed by removing the CloseHandle() call. No test case added because it's not possible to test for absence of dead code. include/my_pthread.h: Bug #26564: Don't call CloseHandle since we use beginthread/endthread instead of beginthreadex/endthreadex.
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r--include/my_pthread.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index e2cce40182d..27b621de925 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -181,8 +181,7 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
#define pthread_kill(A,B) pthread_dummy(0)
-#define pthread_join(A,B) \
- ((WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0) || !CloseHandle(A))
+#define pthread_join(A,B) (WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0)
/* Dummy defines for easier code */
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)