// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// if it's FALSE, some secondary thread is holding the GUI lock
static bool gs_bGuiOwnedByMainThread = TRUE;
// if it's FALSE, some secondary thread is holding the GUI lock
static bool gs_bGuiOwnedByMainThread = TRUE;
private:
// Threads in OS/2 have only an ID, so m_hThread is both it's handle and ID
// PM also has no real Tls mechanism to index pointers by so we'll just
private:
// Threads in OS/2 have only an ID, so m_hThread is both it's handle and ID
// PM also has no real Tls mechanism to index pointers by so we'll just
TID m_hThread; // handle and ID of the thread
wxThreadState m_eState; // state, see wxThreadState enum
unsigned int m_nPriority; // thread priority in "wx" units
TID m_hThread; // handle and ID of the thread
wxThreadState m_eState; // state, see wxThreadState enum
unsigned int m_nPriority; // thread priority in "wx" units
if (!uStackSize)
uStackSize = 131072;
pThread->m_critsect.Enter();
tid = _beginthread(wxThreadInternal::OS2ThreadStart,
if (!uStackSize)
uStackSize = 131072;
pThread->m_critsect.Enter();
tid = _beginthread(wxThreadInternal::OS2ThreadStart,
// we can't just wait for the thread to terminate because it might be
// calling some GUI functions and so it will never terminate before we
// process the Windows messages that result from these functions
// we can't just wait for the thread to terminate because it might be
// calling some GUI functions and so it will never terminate before we
// process the Windows messages that result from these functions
- if ( IsMain() )
- {
- // event processing - needed if we are the main thread
- // to give other threads a chance to do remaining GUI
- // processing and terminate cleanly.
- wxTheApp->HandleSockets();
- if (wxTheApp->Pending())
- if ( !wxTheApp->DoMessage() )
- {
- // WM_QUIT received: kill the thread
- Kill();
-
- return wxTHREAD_KILLED;
- }
- else
- wxUsleep(10);
- }
- else
- wxUsleep(10);
+ if ( IsMain() )
+ {
+ // event processing - needed if we are the main thread
+ // to give other threads a chance to do remaining GUI
+ // processing and terminate cleanly.
+ wxTheApp->HandleSockets();
+ if (wxTheApp->Pending())
+ if ( !wxTheApp->DoMessage() )
+ {
+ // WM_QUIT received: kill the thread
+ Kill();
+
+ return wxTHREAD_KILLED;
+ }
+ else
+ wxUsleep(10);
+ }
+ else
+ wxUsleep(10);