// wxMutex implementation
// ----------------------------------------------------------------------------
+static bool wxMacMPThreadsInitVerify()
+{
+ static bool hasThreadManager = false ;
+ if ( !hasThreadManager )
+ hasThreadManager = MPLibraryIsLoaded();
+
+ if ( !hasThreadManager )
+ {
+ wxMessageBox( wxT("Error") , wxT("MP Thread Support is not available on this System" ), wxOK ) ;
+ return FALSE ;
+ }
+ return TRUE ;
+}
+
#if 0
class wxMutexInternal
wxMutexInternal::wxMutexInternal(wxMutexType mutexType )
{
+ wxMacMPThreadsInitVerify() ;
+
m_isOk = false ;
m_semaphore = kInvalidID ;
wxMutexInternal::wxMutexInternal(wxMutexType mutexType )
{
+ wxMacMPThreadsInitVerify() ;
m_isOk = false ;
m_critRegion = kInvalidID ;
wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount)
{
+ wxMacMPThreadsInitVerify() ;
m_isOk = false ;
m_semaphore = kInvalidID ;
if ( maxcount == 0 )
bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
{
+ wxMacMPThreadsInitVerify() ;
wxASSERT_MSG( m_state == STATE_NEW && !m_tid,
_T("Create()ing thread twice?") );
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
bool wxThreadModule::OnInit()
-{
- bool hasThreadManager = false ;
- hasThreadManager = MPLibraryIsLoaded();
-
- if ( !hasThreadManager )
+{
+ if ( !wxMacMPThreadsInitVerify() )
{
- wxMessageBox( wxT("Error") , wxT("MP Thread Support is not available on this System" ), wxOK ) ;
return FALSE ;
}