]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/thread.h
define wxMAKE_UNIQUE_NAME so that it works even in VC++ with /ZI (edit and continue...
[wxWidgets.git] / include / wx / thread.h
index 6c92c2c425dbf76af09aa966e6aa7da9a97cef4e..07f886e973f17968c752b828785bfd3ee2d07fc1 100644 (file)
     #undef Yield
 #endif
 
     #undef Yield
 #endif
 
+#ifdef __WXMSW__
+    #include "wx/msw/wrapwin.h"
+#endif
+
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
@@ -243,8 +247,7 @@ private:
     // include windows.h from this public header and we also have to use the
     // union to force the correct (i.e. maximal) alignment
     //
     // include windows.h from this public header and we also have to use the
     // union to force the correct (i.e. maximal) alignment
     //
-    // if CRITICAL_SECTION size changes in Windows, you'll get an assert from
-    // thread.cpp and will need to increase the buffer size
+    // if CRITICAL_SECTION size changes in Windows, you'll get an assert below
     //
     // finally, we need this typedef instead of declaring m_buffer directly
     // because otherwise the assert mentioned above wouldn't compile with some
     //
     // finally, we need this typedef instead of declaring m_buffer directly
     // because otherwise the assert mentioned above wouldn't compile with some
@@ -254,6 +257,10 @@ private:
 #else // __WIN32__
     typedef char wxCritSectBuffer[24];
 #endif
 #else // __WIN32__
     typedef char wxCritSectBuffer[24];
 #endif
+
+wxCOMPILE_TIME_ASSERT( sizeof(CRITICAL_SECTION) <= sizeof(wxCritSectBuffer),
+                       wxCriticalSectionBufferTooSmall );
+
     union
     {
         unsigned long m_dummy1;
     union
     {
         unsigned long m_dummy1;
@@ -321,7 +328,7 @@ public:
     bool IsOk() const;
 
     // NB: the associated mutex MUST be locked beforehand by the calling thread
     bool IsOk() const;
 
     // NB: the associated mutex MUST be locked beforehand by the calling thread
-    // 
+    //
     // it atomically releases the lock on the associated mutex
     // and starts waiting to be woken up by a Signal()/Broadcast()
     // once its signaled, then it will wait until it can reacquire
     // it atomically releases the lock on the associated mutex
     // and starts waiting to be woken up by a Signal()/Broadcast()
     // once its signaled, then it will wait until it can reacquire
@@ -332,7 +339,7 @@ public:
     // timeout ellapses even if the condition hasn't been signalled: in this
     // case, the return value is false, otherwise (i.e. in case of a normal
     // return) it is true
     // timeout ellapses even if the condition hasn't been signalled: in this
     // case, the return value is false, otherwise (i.e. in case of a normal
     // return) it is true
-    // 
+    //
     // the timeeout parameter specifies a interval that needs to be waited in
     // milliseconds
     wxCondError WaitTimeout(unsigned long milliseconds);
     // the timeeout parameter specifies a interval that needs to be waited in
     // milliseconds
     wxCondError WaitTimeout(unsigned long milliseconds);