]> git.saurik.com Git - wxWidgets.git/commitdiff
moved Watcom thread stack size fix from .h to the .cpp
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 Jan 2002 19:07:32 +0000 (19:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 Jan 2002 19:07:32 +0000 (19:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/thread.h
src/msw/thread.cpp

index c4f09dc254d721780cb612864bf9e21f0be87204..f80aa89bf515af96b77c2c15ffaa59efae0cdc0e 100644 (file)
@@ -307,11 +307,7 @@ public:
         // platforms that support that - call Run() to start it
         // (special cased for watcom which won't accept 0 default)
 
-#ifdef __WATCOMC__
-    wxThreadError Create(unsigned int stackSize = 10240);
-#else
     wxThreadError Create(unsigned int stackSize = 0);
-#endif
 
         // starts execution of the thread - from the moment Run() is called
         // the execution of wxThread::Entry() may start at any moment, caller
index de8b88290855db495f5e54122d31166576eadd29..8320440d20a1ac1b239db21ab8b3d29bdfbf25df 100644 (file)
@@ -520,6 +520,14 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
     // creation instead of Win32 API one because otherwise we will have memory
     // leaks if the thread uses C RTL (and most threads do)
 #ifdef wxUSE_BEGIN_THREAD
+
+    // Watcom is reported to not like 0 stack size (which means "use default"
+    // for the other compilers and is also the default value for stackSize)
+#ifdef __WATCOMC__
+    if ( !stackSize )
+        stackSize = 10240;
+#endif // __WATCOMC__
+
     m_hThread = (HANDLE)_beginthreadex
                         (
                           NULL,                             // default security
@@ -533,7 +541,7 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
     m_hThread = ::CreateThread
                   (
                     NULL,                               // default security
-                    stackSize,                          // default stack size
+                    stackSize,                          // stack size
                     wxThreadInternal::WinThreadStart,   // thread entry point
                     (LPVOID)thread,                     // parameter
                     CREATE_SUSPENDED,                   // flags