]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/thread.h
wxMenuBarBase for MSW (untested)
[wxWidgets.git] / include / wx / thread.h
index d4bb7aeac3efbb5ae17ec08d17cba59ea70dcc80..c47aca344955d9bd717e52dad4c1e72afaa4e62b 100644 (file)
@@ -134,7 +134,7 @@ private:
 
 // in order to avoid any overhead under !MSW make all wxCriticalSection class
 // functions inline - but this can't be done under MSW
-#ifdef __WXMSW__
+#if defined(__WXMSW__) || defined(__WXPM__)
     class WXDLLEXPORT wxCriticalSectionInternal;
     #define WXCRITICAL_INLINE
 #else // !MSW
@@ -350,14 +350,26 @@ private:
 void WXDLLEXPORT wxMutexGuiEnter();
 void WXDLLEXPORT wxMutexGuiLeave();
 
+// macros for entering/leaving critical sections which may be used without
+// having to take them inside "#if wxUSE_THREADS"
+#define wxENTER_CRIT_SECT(cs)   (cs)->Enter()
+#define wxLEAVE_CRIT_SECT(cs)   (cs)->Leave()
+#define wxCRIT_SECT_LOCKER(name, cs)  wxCriticalSectionLocker name(*cs)
+
 #else // !wxUSE_THREADS
 
-#include <wx/defs.h> // for WXDLLEXPORT
+#include "wx/defs.h" // for WXDLLEXPORT
 
 // no thread support
 inline void WXDLLEXPORT wxMutexGuiEnter() { }
 inline void WXDLLEXPORT wxMutexGuiLeave() { }
 
+// macros for entering/leaving critical sections which may be used without
+// having to take them inside "#if wxUSE_THREADS"
+#define wxENTER_CRIT_SECT(cs)
+#define wxLEAVE_CRIT_SECT(cs)
+#define wxCRIT_SECT_LOCKER(name, cs)
+
 #endif // wxUSE_THREADS
 
 // automatically unlock GUI mutex in dtor