MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:kgeorge Date:June 25 2007 4:21pm
Subject:bk commit into 5.1 tree (gkodinov:1.2515) BUG#26564
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-06-25 19:21:18+03:00, gkodinov@stripped +1 -0
  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@stripped, 2007-06-25 19:21:16+03:00, gkodinov@stripped +1 -2
    Bug #26564: Don't call CloseHandle since we use 
    beginthread/endthread instead of beginthreadex/endthreadex.

diff -Nrup a/include/my_pthread.h b/include/my_pthread.h
--- a/include/my_pthread.h	2007-06-01 10:43:50 +03:00
+++ b/include/my_pthread.h	2007-06-25 19:21:16 +03:00
@@ -181,8 +181,7 @@ void pthread_exit(void *a);	 /* was #def
 #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)
Thread
bk commit into 5.1 tree (gkodinov:1.2515) BUG#26564kgeorge25 Jun