git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27369
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// wxMutex implementation
// ----------------------------------------------------------------------------
// 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
#if 0
class wxMutexInternal
wxMutexInternal::wxMutexInternal(wxMutexType mutexType )
{
wxMutexInternal::wxMutexInternal(wxMutexType mutexType )
{
+ wxMacMPThreadsInitVerify() ;
+
m_isOk = false ;
m_semaphore = kInvalidID ;
m_isOk = false ;
m_semaphore = kInvalidID ;
wxMutexInternal::wxMutexInternal(wxMutexType mutexType )
{
wxMutexInternal::wxMutexInternal(wxMutexType mutexType )
{
+ wxMacMPThreadsInitVerify() ;
m_isOk = false ;
m_critRegion = kInvalidID ;
m_isOk = false ;
m_critRegion = kInvalidID ;
wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount)
{
wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount)
{
+ wxMacMPThreadsInitVerify() ;
m_isOk = false ;
m_semaphore = kInvalidID ;
if ( maxcount == 0 )
m_isOk = false ;
m_semaphore = kInvalidID ;
if ( maxcount == 0 )
bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
{
bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
{
+ wxMacMPThreadsInitVerify() ;
wxASSERT_MSG( m_state == STATE_NEW && !m_tid,
_T("Create()ing thread twice?") );
wxASSERT_MSG( m_state == STATE_NEW && !m_tid,
_T("Create()ing thread twice?") );
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
bool wxThreadModule::OnInit()
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 ) ;