1999-01-02 23:02:30 +00:00
|
|
|
\section{\class{wxMutexLocker}}\label{wxmutexlocker}
|
|
|
|
|
|
|
|
This is a small helper class to be used with \helpref{wxMutex}{wxmutex}
|
|
|
|
objects. A wxMutexLocker acquires a mutex lock in the constructor and releases
|
|
|
|
(or unlocks) the mutex in the destructor making it much more difficult to
|
|
|
|
forget to release a mutex (which, in general, will promptly lead to the serious
|
|
|
|
problems). See \helpref{wxMutex}{wxmutex} for an example of wxMutexLocker
|
|
|
|
usage.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
None.
|
|
|
|
|
1999-02-15 20:41:29 +00:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/thread.h>
|
|
|
|
|
1999-01-02 23:02:30 +00:00
|
|
|
\wxheading{See also}
|
|
|
|
|
1999-01-07 08:43:47 +00:00
|
|
|
\helpref{wxMutex}{wxmutex}, \helpref{wxCriticalSectionLocker}{wxcriticalsectionlocker}
|
1999-01-02 23:02:30 +00:00
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxMutexLocker::wxMutexLocker}\label{wxmutexlockerctor}
|
1999-01-07 08:43:47 +00:00
|
|
|
|
1999-01-02 23:02:30 +00:00
|
|
|
\func{}{wxMutexLocker}{\param{wxMutex *}{mutex}}
|
|
|
|
|
|
|
|
Constructs a wxMutexLocker object associated with mutex which must be non NULL
|
1999-01-07 08:43:47 +00:00
|
|
|
and locks it. Call \helpref{IsLocked}{wxmutexlockerisok} to check if the mutex was
|
1999-01-02 23:02:30 +00:00
|
|
|
successfully locked.
|
|
|
|
|
|
|
|
\membersection{wxMutexLocker::\destruct{wxMutexLocker}}\label{wxmutexlockerdtor}
|
1999-01-07 08:43:47 +00:00
|
|
|
|
1999-01-02 23:02:30 +00:00
|
|
|
\func{}{\destruct{wxMutexLocker}}{\void}
|
|
|
|
|
|
|
|
Destuctor releases the mutex if it was successfully acquired in the ctor.
|
|
|
|
|
|
|
|
\membersection{wxMutexLocker::IsOk}\label{wxmutexlockerisok}
|
1999-01-07 08:43:47 +00:00
|
|
|
|
1999-01-02 23:02:30 +00:00
|
|
|
\constfunc{bool}{IsOk}{\void}
|
|
|
|
|
|
|
|
Returns TRUE if mutex was acquired in the constructor, FALSE otherwise.
|
1999-01-07 08:43:47 +00:00
|
|
|
|