]>
Commit | Line | Data |
---|---|---|
6e6110ee VZ |
1 | \section{\class{wxMutexLocker}}\label{wxmutexlocker} |
2 | ||
3 | This is a small helper class to be used with \helpref{wxMutex}{wxmutex} | |
4 | objects. A wxMutexLocker acquires a mutex lock in the constructor and releases | |
5 | (or unlocks) the mutex in the destructor making it much more difficult to | |
6 | forget to release a mutex (which, in general, will promptly lead to the serious | |
7 | problems). See \helpref{wxMutex}{wxmutex} for an example of wxMutexLocker | |
8 | usage. | |
9 | ||
10 | \wxheading{Derived from} | |
11 | ||
12 | None. | |
13 | ||
954b8ae6 JS |
14 | \wxheading{Include files} |
15 | ||
16 | <wx/thread.h> | |
17 | ||
6e6110ee VZ |
18 | \wxheading{See also} |
19 | ||
2432b92d | 20 | \helpref{wxMutex}{wxmutex}, \helpref{wxCriticalSectionLocker}{wxcriticalsectionlocker} |
6e6110ee VZ |
21 | |
22 | \latexignore{\rtfignore{\wxheading{Members}}} | |
23 | ||
24 | \membersection{wxMutexLocker::wxMutexLocker}\label{wxmutexlockerctor} | |
2432b92d | 25 | |
6e6110ee VZ |
26 | \func{}{wxMutexLocker}{\param{wxMutex *}{mutex}} |
27 | ||
f6bcfd97 | 28 | Constructs a wxMutexLocker object associated with mutex which must be non-NULL |
2432b92d | 29 | and locks it. Call \helpref{IsLocked}{wxmutexlockerisok} to check if the mutex was |
6e6110ee VZ |
30 | successfully locked. |
31 | ||
32 | \membersection{wxMutexLocker::\destruct{wxMutexLocker}}\label{wxmutexlockerdtor} | |
2432b92d | 33 | |
6e6110ee VZ |
34 | \func{}{\destruct{wxMutexLocker}}{\void} |
35 | ||
36 | Destuctor releases the mutex if it was successfully acquired in the ctor. | |
37 | ||
38 | \membersection{wxMutexLocker::IsOk}\label{wxmutexlockerisok} | |
2432b92d | 39 | |
6e6110ee VZ |
40 | \constfunc{bool}{IsOk}{\void} |
41 | ||
42 | Returns TRUE if mutex was acquired in the constructor, FALSE otherwise. | |
2432b92d | 43 |