X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c3d7e2d777b4c5892adadf3e658b8923645ae04..2ed57eb790d9e1f18adb50ec122f1ee17152018c:/include/wx/thread.h diff --git a/include/wx/thread.h b/include/wx/thread.h index cb3f019236..82c7847447 100644 --- a/include/wx/thread.h +++ b/include/wx/thread.h @@ -13,10 +13,6 @@ #ifndef __THREADH__ #define __THREADH__ -#ifdef __GNUG__ - #pragma interface "thread.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -25,6 +21,10 @@ #include "wx/setup.h" #if wxUSE_THREADS +/* otherwise we get undefined references for non-thread case (KB)*/ +#ifdef __GNUG__ + #pragma interface "thread.h" +#endif // Windows headers define it #ifdef Yield @@ -151,9 +151,9 @@ public: WXCRITICAL_INLINE ~wxCriticalSection(); // enter the section (the same as locking a mutex) - void WXCRITICAL_INLINE Enter(); + WXCRITICAL_INLINE void Enter(); // leave the critical section (same as unlocking a mutex) - void WXCRITICAL_INLINE Leave(); + WXCRITICAL_INLINE void Leave(); private: // no assignment operator nor copy ctor @@ -312,7 +312,7 @@ protected: // Returns TRUE if the thread was asked to terminate: this function should // be called by the thread from time to time, otherwise the main thread // will be left forever in Delete()! - bool TestDestroy() const; + bool TestDestroy(); // exits from the current thread - can be called only from this thread void Exit(void *exitcode = 0); @@ -352,6 +352,8 @@ void WXDLLEXPORT wxMutexGuiLeave(); #else // !wxUSE_THREADS +#include // for WXDLLEXPORT + // no thread support inline void WXDLLEXPORT wxMutexGuiEnter() { } inline void WXDLLEXPORT wxMutexGuiLeave() { } @@ -369,7 +371,7 @@ public: // ----------------------------------------------------------------------------- // implementation only until the end of file // ----------------------------------------------------------------------------- -#ifdef wxUSE_THREADS +#if wxUSE_THREADS #ifdef __WXMSW__ // unlock GUI if there are threads waiting for and lock it back when // there are no more of them - should be called periodically by the main