make POSIX and Windows implementation of wxThread::Run() coherently assert when trying to Run() a thread twice; add a test for it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1077,11 +1077,8 @@ wxThreadError wxThread::Run()
|
||||
{
|
||||
wxCriticalSectionLocker lock(m_critsect);
|
||||
|
||||
if ( m_internal->GetState() != STATE_NEW )
|
||||
{
|
||||
// actually, it may be almost any state at all, not only STATE_RUNNING
|
||||
return wxTHREAD_RUNNING;
|
||||
}
|
||||
wxCHECK_MSG( m_internal->GetState() == STATE_NEW, wxTHREAD_RUNNING,
|
||||
wxT("thread may only be started once after Create()") );
|
||||
|
||||
// the thread has just been created and is still suspended - let it run
|
||||
return Resume();
|
||||
|
Reference in New Issue
Block a user