5309 kevin.lewis@stripped 2012-12-28
Bug#14762796 - Intermittent failures of several testcases on Windows
due to the previous fix. It seems that threads need to be explicitly
exited with ExitThread() in C++ despite the adice in MSDN. Also,
a Sleep(0) is added in order to wait for the created thread to get
going before closing the Windows handle to the thread object.
modified:
storage/innobase/os/os0thread.cc
5308 Sunny Bains 2012-12-29 [merge]
Merge from mysql-5.6.
modified:
storage/innobase/os/os0file.cc
=== modified file 'storage/innobase/os/os0thread.cc'
--- a/storage/innobase/os/os0thread.cc revid:sunny.bains@stripped
+++ b/storage/innobase/os/os0thread.cc revid:kevin.lewis@stripped
@@ -140,7 +140,9 @@ os_thread_create_func(
It only uses the thread_id. So close the handle now.
The thread object is held open by the thread until it
exits. */
+ Sleep(0);
CloseHandle(handle);
+
} else {
/* If we cannot start a new thread, life has no meaning. */
fprintf(stderr,
@@ -222,14 +224,7 @@ os_thread_exit(
os_mutex_exit(os_sync_mutex);
#ifdef __WIN__
-# ifndef __cplusplus
- /* "ExitThread is the preferred method of exiting a thread in C code
- However, in C++ code, the thread is exited before any destructors
- can be called or any other automatic cleanup can be performed.
- Therefore, in C++ code, you should return from your thread function."
- (msdn.microsoft.com) */
ExitThread((DWORD) exit_value);
-# endif
#else
pthread_detach(pthread_self());
pthread_exit(exit_value);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (kevin.lewis:5308 to 5309) Bug#14762796 | kevin.lewis | 11 Jan 2013 |