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
|
2005-11-19 01:07:56 +00:00
|
|
|
forget to release a mutex (which, in general, will promptly lead to serious
|
1999-01-02 23:02:30 +00:00
|
|
|
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
|
|
|
|
2003-01-02 01:00:17 +00:00
|
|
|
\func{}{wxMutexLocker}{\param{wxMutex\&}{ mutex}}
|
1999-01-02 23:02:30 +00:00
|
|
|
|
2003-01-02 01:00:17 +00:00
|
|
|
Constructs a wxMutexLocker object associated with mutex 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}
|
|
|
|
|
2002-06-07 20:15:28 +00:00
|
|
|
Destructor releases the mutex if it was successfully acquired in the ctor.
|
1999-01-02 23:02:30 +00:00
|
|
|
|
|
|
|
\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}
|
|
|
|
|
2003-01-18 00:16:34 +00:00
|
|
|
Returns true if mutex was acquired in the constructor, false otherwise.
|
1999-01-07 08:43:47 +00:00
|
|
|
|