From 50ef440170c9fd2f55940782ab7e091ca87dc01e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 8 May 2003 23:38:05 +0000 Subject: [PATCH] undid patch which was supposed to allow thread recreation and added instead an assert preventing it git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/thread.cpp | 5 +++-- src/unix/threadpsx.cpp | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 92f34c9ca8..df5f2f2ba7 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -629,6 +629,9 @@ void wxThreadInternal::SetPriority(unsigned int priority) bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) { + wxASSERT_MSG( m_state == STATE_NEW && !m_hThread, + _T("Create()ing thread twice?") ); + // for compilers which have it, we should use C RTL function for thread // creation instead of Win32 API one because otherwise we will have memory // leaks if the thread uses C RTL (and most threads do) @@ -674,8 +677,6 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) SetPriority(m_priority); } - m_state = STATE_NEW; - return TRUE; } diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index a124ad443b..597f87eb8d 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -1183,8 +1183,6 @@ wxThreadError wxThread::Create(unsigned int WXUNUSED(stackSize)) return wxTHREAD_NO_RESOURCE; } - m_internal->SetState( STATE_NEW ); - return wxTHREAD_NO_ERROR; } -- 2.45.2