git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1033
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
14 files changed:
}
void wxMutexGuiLeave()
{
}
void wxMutexGuiLeave()
{
void wxThread::SetPriority(int WXUNUSED(prio)) { }
int wxThread::GetPriority() const { return 0; }
void wxThread::SetPriority(int WXUNUSED(prio)) { }
int wxThread::GetPriority() const { return 0; }
-wxMutex wxMainMutex; // controls access to all GUI functions
+wxMutex *wxMainMutex; // controls access to all GUI functions
};
bool wxThreadModule::OnInit() {
};
bool wxThreadModule::OnInit() {
+ wxMainMutex = new wxMutex();
+ wxMainMutex->Lock();
return TRUE;
}
void wxThreadModule::OnExit()
{
return TRUE;
}
void wxThreadModule::OnExit()
{
+ wxMainMutex->Unlock();
+ delete wxMainMutex;
}
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
}
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
static wxMutex p_list_mutex;
static wxList p_threads_list;
static wxMutex p_list_mutex;
static wxList p_threads_list;
-wxMutex wxMainMutex; // controls access to all GUI functions
+wxMutex *wxMainMutex; // controls access to all GUI functions
/////////////////////////////////////////////////////////////////////////////
// GUI thread manager
/////////////////////////////////////////////////////////////////////////////
// GUI thread manager
wxYield();
if (do_unlock)
wxYield();
if (do_unlock)
pthread_join(p_internal->thread_id, &status);
if (do_unlock)
pthread_join(p_internal->thread_id, &status);
if (do_unlock)
p_list_mutex.Lock();
delete p_threads_list.Nth(p_internal->id);
p_list_mutex.Lock();
delete p_threads_list.Nth(p_internal->id);
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
+ wxMainMutex = new wxMutex();
wxThreadGuiInit();
p_mainid = pthread_self();
p_threads_list = wxList(wxKEY_INTEGER);
wxThreadGuiInit();
p_mainid = pthread_self();
p_threads_list = wxList(wxKEY_INTEGER);
return TRUE;
}
virtual void OnExit() {
return TRUE;
}
virtual void OnExit() {
/////////////////////////////////////////////////////////////////////////////
static int p_mainid;
/////////////////////////////////////////////////////////////////////////////
static int p_mainid;
waitpid(p_internal->thread_id, &stat, 0);
if (do_unlock)
waitpid(p_internal->thread_id, &stat, 0);
if (do_unlock)
if (!WIFEXITED(stat) && !WIFSIGNALED(stat))
return 0;
p_internal->state = STATE_IDLE;
if (!WIFEXITED(stat) && !WIFSIGNALED(stat))
return 0;
p_internal->state = STATE_IDLE;
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
+ wxMainMutex = new wxMutex();
wxThreadGuiInit();
p_mainid = (int)getpid();
wxThreadGuiInit();
p_mainid = (int)getpid();
}
virtual void OnExit() {
}
virtual void OnExit() {
}
void wxMutexGuiLeave()
{
}
void wxMutexGuiLeave()
{
void wxThread::SetPriority(int WXUNUSED(prio)) { }
int wxThread::GetPriority() const { return 0; }
void wxThread::SetPriority(int WXUNUSED(prio)) { }
int wxThread::GetPriority() const { return 0; }
-wxMutex wxMainMutex; // controls access to all GUI functions
+wxMutex *wxMainMutex; // controls access to all GUI functions
};
bool wxThreadModule::OnInit() {
};
bool wxThreadModule::OnInit() {
+ wxMainMutex = new wxMutex();
+ wxMainMutex->Lock();
return TRUE;
}
void wxThreadModule::OnExit()
{
return TRUE;
}
void wxThreadModule::OnExit()
{
+ wxMainMutex->Unlock();
+ delete wxMainMutex;
}
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
}
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
static wxMutex p_list_mutex;
static wxList p_threads_list;
static wxMutex p_list_mutex;
static wxList p_threads_list;
-wxMutex wxMainMutex; // controls access to all GUI functions
+wxMutex *wxMainMutex; // controls access to all GUI functions
/////////////////////////////////////////////////////////////////////////////
// GUI thread manager
/////////////////////////////////////////////////////////////////////////////
// GUI thread manager
wxYield();
if (do_unlock)
wxYield();
if (do_unlock)
pthread_join(p_internal->thread_id, &status);
if (do_unlock)
pthread_join(p_internal->thread_id, &status);
if (do_unlock)
p_list_mutex.Lock();
delete p_threads_list.Nth(p_internal->id);
p_list_mutex.Lock();
delete p_threads_list.Nth(p_internal->id);
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
+ wxMainMutex = new wxMutex();
wxThreadGuiInit();
p_mainid = pthread_self();
p_threads_list = wxList(wxKEY_INTEGER);
wxThreadGuiInit();
p_mainid = pthread_self();
p_threads_list = wxList(wxKEY_INTEGER);
return TRUE;
}
virtual void OnExit() {
return TRUE;
}
virtual void OnExit() {
/////////////////////////////////////////////////////////////////////////////
static int p_mainid;
/////////////////////////////////////////////////////////////////////////////
static int p_mainid;
waitpid(p_internal->thread_id, &stat, 0);
if (do_unlock)
waitpid(p_internal->thread_id, &stat, 0);
if (do_unlock)
if (!WIFEXITED(stat) && !WIFSIGNALED(stat))
return 0;
p_internal->state = STATE_IDLE;
if (!WIFEXITED(stat) && !WIFSIGNALED(stat))
return 0;
p_internal->state = STATE_IDLE;
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
+ wxMainMutex = new wxMutex();
wxThreadGuiInit();
p_mainid = (int)getpid();
wxThreadGuiInit();
p_mainid = (int)getpid();
}
virtual void OnExit() {
}
virtual void OnExit() {
// Static variables
/////////////////////////////////////////////////////////////////////////////
// Static variables
/////////////////////////////////////////////////////////////////////////////
-wxMutex wxMainMutex; // controls access to all GUI functions
+wxMutex *wxMainMutex; // controls access to all GUI functions
/////////////////////////////////////////////////////////////////////////////
// Windows implementation
/////////////////////////////////////////////////////////////////////////////
// Windows implementation
public:
virtual bool OnInit() {
/* TODO p_mainid = GetCurrentThread(); */
public:
virtual bool OnInit() {
/* TODO p_mainid = GetCurrentThread(); */
+ wxMainMutex = new wxMutex();
+ wxMainMutex->Lock();
return TRUE;
}
// Global cleanup
virtual void OnExit() {
return TRUE;
}
// Global cleanup
virtual void OnExit() {
+ wxMainMutex->Unlock();
+ delete wxMainMutex;
/////////////////////////////////////////////////////////////////////////////
static HANDLE p_mainid;
/////////////////////////////////////////////////////////////////////////////
static HANDLE p_mainid;
-wxMutex wxMainMutex; // controls access to all GUI functions
+wxMutex *wxMainMutex; // controls access to all GUI functions
/////////////////////////////////////////////////////////////////////////////
// Windows implementation
/////////////////////////////////////////////////////////////////////////////
// Windows implementation
return NULL;
if (wxThread::IsMain())
return NULL;
if (wxThread::IsMain())
WaitForSingleObject(p_internal->thread_id, INFINITE);
if (wxThread::IsMain())
WaitForSingleObject(p_internal->thread_id, INFINITE);
if (wxThread::IsMain())
GetExitCodeThread(p_internal->thread_id, &exit_code);
CloseHandle(p_internal->thread_id);
GetExitCodeThread(p_internal->thread_id, &exit_code);
CloseHandle(p_internal->thread_id);
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
+ wxMainMutex = new wxMutex();
p_mainid = GetCurrentThread();
p_mainid = GetCurrentThread();
return TRUE;
}
// Global cleanup
virtual void OnExit() {
return TRUE;
}
// Global cleanup
virtual void OnExit() {
+ wxMainMutex->Unlock();
+ delete wxMainMutex;
void wxThread::SetPriority(int WXUNUSED(prio)) { }
int wxThread::GetPriority() const { return 0; }
void wxThread::SetPriority(int WXUNUSED(prio)) { }
int wxThread::GetPriority() const { return 0; }
-wxMutex wxMainMutex; // controls access to all GUI functions
+wxMutex *wxMainMutex; // controls access to all GUI functions
};
bool wxThreadModule::OnInit() {
};
bool wxThreadModule::OnInit() {
+ wxMainMutex = new wxMutex();
+ wxMainMutex->Lock();
return TRUE;
}
void wxThreadModule::OnExit()
{
return TRUE;
}
void wxThreadModule::OnExit()
{
+ wxMainMutex->Unlock();
+ delete wxMainMutex;
}
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
}
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
static wxMutex p_list_mutex;
static wxList p_threads_list;
static wxMutex p_list_mutex;
static wxList p_threads_list;
-wxMutex wxMainMutex; // controls access to all GUI functions
+wxMutex *wxMainMutex; // controls access to all GUI functions
/////////////////////////////////////////////////////////////////////////////
// GUI thread manager
/////////////////////////////////////////////////////////////////////////////
// GUI thread manager
wxYield();
if (do_unlock)
wxYield();
if (do_unlock)
pthread_join(p_internal->thread_id, &status);
if (do_unlock)
pthread_join(p_internal->thread_id, &status);
if (do_unlock)
p_list_mutex.Lock();
delete p_threads_list.Nth(p_internal->id);
p_list_mutex.Lock();
delete p_threads_list.Nth(p_internal->id);
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
+ wxMainMutex = new wxMutex();
wxThreadGuiInit();
p_mainid = pthread_self();
p_threads_list = wxList(wxKEY_INTEGER);
wxThreadGuiInit();
p_mainid = pthread_self();
p_threads_list = wxList(wxKEY_INTEGER);
return TRUE;
}
virtual void OnExit() {
return TRUE;
}
virtual void OnExit() {
/////////////////////////////////////////////////////////////////////////////
static int p_mainid;
/////////////////////////////////////////////////////////////////////////////
static int p_mainid;
waitpid(p_internal->thread_id, &stat, 0);
if (do_unlock)
waitpid(p_internal->thread_id, &stat, 0);
if (do_unlock)
if (!WIFEXITED(stat) && !WIFSIGNALED(stat))
return 0;
p_internal->state = STATE_IDLE;
if (!WIFEXITED(stat) && !WIFSIGNALED(stat))
return 0;
p_internal->state = STATE_IDLE;
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
virtual bool OnInit() {
+ wxMainMutex = new wxMutex();
wxThreadGuiInit();
p_mainid = (int)getpid();
wxThreadGuiInit();
p_mainid = (int)getpid();
}
virtual void OnExit() {
}
virtual void OnExit() {
// Static variables
/////////////////////////////////////////////////////////////////////////////
// Static variables
/////////////////////////////////////////////////////////////////////////////
-wxMutex wxMainMutex; // controls access to all GUI functions
+wxMutex *wxMainMutex; // controls access to all GUI functions
/////////////////////////////////////////////////////////////////////////////
// Windows implementation
/////////////////////////////////////////////////////////////////////////////
// Windows implementation
public:
virtual bool OnInit() {
/* TODO p_mainid = GetCurrentThread(); */
public:
virtual bool OnInit() {
/* TODO p_mainid = GetCurrentThread(); */
+ wxMainMutex = new wxMutex();
+ wxMainMutex->Lock();
return TRUE;
}
// Global cleanup
virtual void OnExit() {
return TRUE;
}
// Global cleanup
virtual void OnExit() {
+ wxMainMutex->Unlock();
+ delete wxMainMutex;