X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93cf77c076b699e8e0b3b0049bd4f80de15997dd..2035e10e83324c6925d12725b842768f6e2b00a2:/src/stubs/thread.cpp diff --git a/src/stubs/thread.cpp b/src/stubs/thread.cpp index 9a03aae3cd..34ad1a4f14 100644 --- a/src/stubs/thread.cpp +++ b/src/stubs/thread.cpp @@ -15,6 +15,9 @@ #include "wx/module.h" #include "wx/thread.h" +#include "wx/utils.h" + +#if wxUSE_THREADS enum thread_state { STATE_IDLE = 0, @@ -27,7 +30,7 @@ enum thread_state { // Static variables ///////////////////////////////////////////////////////////////////////////// -wxMutex wxMainMutex; // controls access to all GUI functions +wxMutex *wxMainMutex; // controls access to all GUI functions ///////////////////////////////////////////////////////////////////////////// // Windows implementation @@ -56,14 +59,14 @@ wxMutexError wxMutex::Lock() { // TODO m_locked++; - return MUTEX_NO_ERROR; + return wxMUTEX_NO_ERROR; } wxMutexError wxMutex::TryLock() { // TODO m_locked++; - return MUTEX_NO_ERROR; + return wxMUTEX_NO_ERROR; } wxMutexError wxMutex::Unlock() @@ -72,7 +75,7 @@ wxMutexError wxMutex::Unlock() m_locked--; // TODO - return MUTEX_NO_ERROR; + return wxMUTEX_NO_ERROR; } class wxConditionInternal { @@ -133,13 +136,25 @@ public: wxThreadError wxThread::Create() { // TODO - return THREAD_NO_ERROR; + return wxTHREAD_NO_ERROR; } wxThreadError wxThread::Destroy() { // TODO - return THREAD_NO_ERROR; + return wxTHREAD_NO_ERROR; +} + +wxThreadError wxThread::Pause() +{ + // TODO + return wxTHREAD_NO_ERROR; +} + +wxThreadError wxThread::Resume() +{ + // TODO + return wxTHREAD_NO_ERROR; } void wxThread::Exit(void *status) @@ -180,9 +195,30 @@ unsigned long wxThread::GetID() const return 0; } +/* +wxThread *wxThread::GetThreadFromID(unsigned long id) +{ + // TODO + return NULL; +} +*/ + +bool wxThread::IsAlive() const +{ + // TODO + return FALSE; +} + +bool wxThread::IsRunning() const +{ + // TODO + return FALSE; +} + bool wxThread::IsMain() { // TODO + return FALSE; } wxThread::wxThread() @@ -211,15 +247,19 @@ class wxThreadModule : public wxModule { public: virtual bool OnInit() { /* TODO p_mainid = GetCurrentThread(); */ - wxMainMutex.Lock(); + wxMainMutex = new wxMutex(); + wxMainMutex->Lock(); return TRUE; } // Global cleanup virtual void OnExit() { - wxMainMutex.Unlock(); + wxMainMutex->Unlock(); + delete wxMainMutex; } }; IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) +#endif + // wxUSE_THREADS