git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1358
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
class WXDLLEXPORT wxMutex
{
public:
class WXDLLEXPORT wxMutex
{
public:
- // constructor & destructor
- wxMutex();
- ~wxMutex();
+ // constructor & destructor
+ wxMutex();
+ ~wxMutex();
- // Lock the mutex.
- wxMutexError Lock();
- // Try to lock the mutex: if it can't, returns immediately with an error.
- wxMutexError TryLock();
- // Unlock the mutex.
- wxMutexError Unlock();
+ // Lock the mutex.
+ wxMutexError Lock();
+ // Try to lock the mutex: if it can't, returns immediately with an error.
+ wxMutexError TryLock();
+ // Unlock the mutex.
+ wxMutexError Unlock();
- // Returns true if the mutex is locked.
- bool IsLocked() const { return (m_locked > 0); }
+ // Returns true if the mutex is locked.
+ bool IsLocked() const { return (m_locked > 0); }
- friend class wxCondition;
+ friend class wxCondition;
- int m_locked;
- wxMutexInternal *p_internal;
+ // no assignment operator nor copy ctor
+ wxMutex(const wxMutex&);
+ wxMutex& operator=(const wxMutex&);
+
+ int m_locked;
+ wxMutexInternal *p_internal;
};
// a helper class which locks the mutex in the ctor and unlocks it in the dtor:
};
// a helper class which locks the mutex in the ctor and unlocks it in the dtor:
~wxMutexLocker() { if ( IsOk() ) m_mutex->Unlock(); }
private:
~wxMutexLocker() { if ( IsOk() ) m_mutex->Unlock(); }
private:
+ // no assignment operator nor copy ctor
+ wxMutexLocker(const wxMutexLocker&);
+ wxMutexLocker& operator=(const wxMutexLocker&);
+
bool m_isOk;
wxMutex *m_mutex;
};
bool m_isOk;
wxMutex *m_mutex;
};
+ // no assignment operator nor copy ctor
+ wxCriticalSection(const wxCriticalSection&);
+ wxCriticalSection& operator=(const wxCriticalSection&);
+
wxCriticalSectionInternal *m_critsect;
};
wxCriticalSectionInternal *m_critsect;
};
{ m_critsect.Leave(); }
private:
{ m_critsect.Leave(); }
private:
+ // no assignment operator nor copy ctor
+ wxCriticalSectionLocker(const wxCriticalSectionLocker&);
+ wxCriticalSectionLocker& operator=(const wxCriticalSectionLocker&);
+
wxCriticalSection& m_critsect;
};
wxCriticalSection& m_critsect;
};