restored inline for wxCriticalSection methods for !MSW
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -212,8 +212,12 @@ private:
|
||||
// just mutexes make all wxCriticalSection class functions inline
|
||||
#if !defined(__WXMSW__) && !defined(__WXPM__)
|
||||
#define wxCRITSECT_IS_MUTEX 1
|
||||
|
||||
#define wxCRITSECT_INLINE inline
|
||||
#else // MSW || OS2
|
||||
#define wxCRITSECT_IS_MUTEX 0
|
||||
|
||||
#define wxCRITSECT_INLINE
|
||||
#endif // MSW/!MSW
|
||||
|
||||
// you should consider wxCriticalSectionLocker whenever possible instead of
|
||||
@@ -222,14 +226,14 @@ class WXDLLEXPORT wxCriticalSection
|
||||
{
|
||||
public:
|
||||
// ctor & dtor
|
||||
wxCriticalSection();
|
||||
~wxCriticalSection();
|
||||
wxCRITSECT_INLINE wxCriticalSection();
|
||||
wxCRITSECT_INLINE ~wxCriticalSection();
|
||||
|
||||
// enter the section (the same as locking a mutex)
|
||||
void Enter();
|
||||
wxCRITSECT_INLINE void Enter();
|
||||
|
||||
// leave the critical section (same as unlocking a mutex)
|
||||
void Leave();
|
||||
wxCRITSECT_INLINE void Leave();
|
||||
|
||||
private:
|
||||
#if wxCRITSECT_IS_MUTEX
|
||||
@@ -251,13 +255,16 @@ private:
|
||||
|
||||
#if wxCRITSECT_IS_MUTEX
|
||||
// implement wxCriticalSection using mutexes
|
||||
wxCriticalSection::wxCriticalSection() { }
|
||||
wxCriticalSection::~wxCriticalSection() { }
|
||||
inline wxCriticalSection::wxCriticalSection() { }
|
||||
inline wxCriticalSection::~wxCriticalSection() { }
|
||||
|
||||
void wxCriticalSection::Enter() { (void)m_mutex.Lock(); }
|
||||
void wxCriticalSection::Leave() { (void)m_mutex.Unlock(); }
|
||||
inline void wxCriticalSection::Enter() { (void)m_mutex.Lock(); }
|
||||
inline void wxCriticalSection::Leave() { (void)m_mutex.Unlock(); }
|
||||
#endif // wxCRITSECT_IS_MUTEX
|
||||
|
||||
#undef wxCRITSECT_INLINE
|
||||
#undef wxCRITSECT_IS_MUTEX
|
||||
|
||||
// wxCriticalSectionLocker is the same to critical sections as wxMutexLocker is
|
||||
// to th mutexes
|
||||
class WXDLLEXPORT wxCriticalSectionLocker
|
||||
|
Reference in New Issue
Block a user