1 \section{\class{wxCriticalSectionLocker
}}\label{wxcriticalsectionlocker
}
3 This is a small helper class to be used with
\helpref{wxCriticalSection
}{wxcriticalsection
}
4 objects. A wxCriticalSectionLocker enters the critical section in the
5 constructor and leaves it in the destructor making it much more difficult to
6 forget to leave a critical section (which, in general, will lead to serious
7 and difficult to debug problems).
14 // gs_critSect is some (global) critical section guarding access to the
16 wxCriticalSectionLocker locker(gs_critSect);
33 Without wxCriticalSectionLocker, you would need to remember to manually leave
34 the critical section before each
{\tt return
}.
36 \wxheading{Derived from
}
40 \wxheading{Include files
}
46 \helpref{wxCriticalSection
}{wxcriticalsection
},
47 \helpref{wxMutexLocker
}{wxmutexlocker
}
49 \latexignore{\rtfignore{\wxheading{Members
}}}
51 \membersection{wxCriticalSectionLocker::wxCriticalSectionLocker
}\label{wxcriticalsectionlockerctor
}
53 \func{}{wxCriticalSectionLocker
}{\param{wxCriticalSection\&
}{criticalsection
}}
55 Constructs a wxCriticalSectionLocker object associated with given
56 {\it criticalsection
} and enters it.
58 \membersection{wxCriticalSectionLocker::
\destruct{wxCriticalSectionLocker
}}\label{wxcriticalsectionlockerdtor
}
60 \func{}{\destruct{wxCriticalSectionLocker
}}{\void}
62 Destuctor leaves the critical section.