]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for FreeBSD compilation
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 9 Nov 1999 14:32:40 +0000 (14:32 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 9 Nov 1999 14:32:40 +0000 (14:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/thread.h

index 2c6f2f8c0e367c029bd6a2be712d15611b464ceb..2140c3f7776e5d8528b1dd5c9bea62f2b6bc4183 100644 (file)
@@ -175,10 +175,8 @@ private:
 class WXDLLEXPORT wxCriticalSectionLocker
 {
 public:
 class WXDLLEXPORT wxCriticalSectionLocker
 {
 public:
-    wxCriticalSectionLocker(wxCriticalSection& critsect) : m_critsect(critsect)
-        { m_critsect.Enter(); }
-    ~wxCriticalSectionLocker()
-        { m_critsect.Leave(); }
+    inline wxCriticalSectionLocker(wxCriticalSection& critsect);
+    inline ~wxCriticalSectionLocker();
 
 private:
     // no assignment operator nor copy ctor
 
 private:
     // no assignment operator nor copy ctor
@@ -383,7 +381,9 @@ public:
 // -----------------------------------------------------------------------------
 // implementation only until the end of file
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // implementation only until the end of file
 // -----------------------------------------------------------------------------
+
 #if wxUSE_THREADS
 #if wxUSE_THREADS
+
 #if defined(__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
 #if defined(__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
@@ -415,6 +415,14 @@ public:
     inline void wxCriticalSection::Enter() { (void)m_mutex.Lock(); }
     inline void wxCriticalSection::Leave() { (void)m_mutex.Unlock(); }
 #endif // MSW/!MSW
     inline void wxCriticalSection::Enter() { (void)m_mutex.Lock(); }
     inline void wxCriticalSection::Leave() { (void)m_mutex.Unlock(); }
 #endif // MSW/!MSW
+
+    // we can define these inline functions now (they should be defined after
+    // wxCriticalSection::Enter/Leave)
+    inline
+    wxCriticalSectionLocker:: wxCriticalSectionLocker(wxCriticalSection& cs)
+        : m_critsect(cs) { m_critsect.Enter(); }
+    inline
+    wxCriticalSectionLocker::~wxCriticalSectionLocker() { m_critsect.Leave(); }
 #endif // wxUSE_THREADS
 
 #endif // __THREADH__
 #endif // wxUSE_THREADS
 
 #endif // __THREADH__