1999-01-02 18:02:30 -05: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
|
2005-11-18 20:07:56 -05:00
|
|
|
forget to release a mutex (which, in general, will promptly lead to serious
|
1999-01-02 18:02:30 -05:00
|
|
|
problems). See \helpref{wxMutex}{wxmutex} for an example of wxMutexLocker
|
|
|
|
usage.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
None.
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/thread.h>
|
|
|
|
|
1999-01-02 18:02:30 -05:00
|
|
|
\wxheading{See also}
|
|
|
|
|
1999-01-07 03:43:47 -05:00
|
|
|
\helpref{wxMutex}{wxmutex}, \helpref{wxCriticalSectionLocker}{wxcriticalsectionlocker}
|
1999-01-02 18:02:30 -05:00
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxMutexLocker::wxMutexLocker}\label{wxmutexlockerctor}
|
1999-01-07 03:43:47 -05:00
|
|
|
|
2003-01-01 20:00:17 -05:00
|
|
|
\func{}{wxMutexLocker}{\param{wxMutex\&}{ mutex}}
|
1999-01-02 18:02:30 -05:00
|
|
|
|
2003-01-01 20:00:17 -05:00
|
|
|
Constructs a wxMutexLocker object associated with mutex and locks it.
|
|
|
|
Call \helpref{IsLocked}{wxmutexlockerisok} to check if the mutex was
|
1999-01-02 18:02:30 -05:00
|
|
|
successfully locked.
|
|
|
|
|
|
|
|
\membersection{wxMutexLocker::\destruct{wxMutexLocker}}\label{wxmutexlockerdtor}
|
1999-01-07 03:43:47 -05:00
|
|
|
|
1999-01-02 18:02:30 -05:00
|
|
|
\func{}{\destruct{wxMutexLocker}}{\void}
|
|
|
|
|
2002-06-07 16:15:28 -04:00
|
|
|
Destructor releases the mutex if it was successfully acquired in the ctor.
|
1999-01-02 18:02:30 -05:00
|
|
|
|
|
|
|
\membersection{wxMutexLocker::IsOk}\label{wxmutexlockerisok}
|
1999-01-07 03:43:47 -05:00
|
|
|
|
1999-01-02 18:02:30 -05:00
|
|
|
\constfunc{bool}{IsOk}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if mutex was acquired in the constructor, false otherwise.
|
1999-01-07 03:43:47 -05:00
|
|
|
|