If the threads module hasn't been initialized yet then we can assume
the IsMain == true. This allows wxASSERTs that happen before the wxApp is created (as can easily happen in wxPython unfortunatly) to behave normally instead of just calling wxTrap. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -113,7 +113,7 @@ WX_DEFINE_ARRAY(wxThread *, wxArrayThread);
|
||||
static wxArrayThread gs_allThreads;
|
||||
|
||||
// the id of the main thread
|
||||
static pthread_t gs_tidMain;
|
||||
static pthread_t gs_tidMain = (pthread_t)-1;
|
||||
|
||||
// the key for the pointer to the associated wxThread object
|
||||
static pthread_key_t gs_keySelf;
|
||||
@@ -957,7 +957,7 @@ wxThread *wxThread::This()
|
||||
|
||||
bool wxThread::IsMain()
|
||||
{
|
||||
return (bool)pthread_equal(pthread_self(), gs_tidMain);
|
||||
return (bool)pthread_equal(pthread_self(), gs_tidMain) || gs_tidMain == (pthread_t)-1;
|
||||
}
|
||||
|
||||
void wxThread::Yield()
|
||||
|
Reference in New Issue
Block a user