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:
Francesco Montorsi
2010-07-25 13:55:36 +00:00
parent 79b7701c0b
commit 89a76d5d2c
3 changed files with 21 additions and 7 deletions

View File

@@ -788,7 +788,7 @@ enum
if (m_pThread) // does the thread still exist?
{
m_out.Printf("MYFRAME: deleting thread");
wxMessageOutputDebug().Printf("MYFRAME: deleting thread");
if (m_pThread->Delete() != wxTHREAD_NO_ERROR )
wxLogError("Can't delete the thread!");
@@ -1125,6 +1125,10 @@ public:
of detached threads.
This function can only be called from another thread context.
Finally, note that once a thread has completed and its Entry() function
returns, you cannot call Run() on it again (an assert will fail in debug
builds or @c wxTHREAD_RUNNING will be returned in release builds).
*/
wxThreadError Run();