wxWidgets/docs/latex/wx/critsect.tex
Vadim Zeitlin 6e6110ee81 1. New classes documented: wxCriticalSection, wxMutexLocker,
wxCriticalSectionLocker
2. New overviews: Threads overview, Container classes overview
3. A modest update of wxList/wxNode docs to bring them up to date
   with the new classes (array.tex is simply empty for the moment)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-01-02 23:02:30 +00:00

50 lines
1.9 KiB
TeX

\section{\class{wxCriticalSection}}\label{wxcriticalsection}
A critical section object is used exactly for the same purpose as
\helpref{mutexes}{wxMutex}. The only difference is that under Windows platform
critical sections are only visible inside one process, while mutexes may be
shared between processes, so using critical sections is slightly more
efficient. The terminology is also slightly different: mutex may be locked (or
acquired) and unlocked (or released) while critical section is entered and left
by the program.
Finally, you should try to use
\helpref{wxCriticalSectionLocker}{wxcriticalsectionlocker} class whenever
possible instead of directly using wxCriticalSection for the same reasons
\helpref{wxMutexLocker}{wxmutexlocker} is preferrable to
\helpref{wxMutex}{wxmutex} - please see wxMutex for an example.
\wxheading{Derived from}
None.
\wxheading{See also}
\helpref{wxThread}{wxthread}, \helpref{wxCondition}{wxcondition},
\helpref{wxMutexLocker}{wxmutexlocker}, \helpref{wxCriticalSection}{wxcriticalsection}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxCriticalSection::wxCriticalSection}\label{wxcriticalsectionctor}
\func{}{wxCriticalSection}{\void}
Default constructor initializes critical section object.
\membersection{wxCriticalSection::\destruct{wxCriticalSection}}\label{wxcriticalsectiondtor}
\func{}{\destruct{wxCriticalSection}}{\void}
Destructor frees the ressources.
\membersection{wxCriticalSection::Enter}\label{wxcriticalsectionenter}
\func{void }{Enter}{\void}
Enter the critical section (same as locking a mutex). There is no error return
for this function. After entering the critical section protecting some global
data the thread running in critical section may safely use/modify it.
\membersection{wxCriticalSection::Leave}\label{wxcriticalsectionleave}
\func{void }{Leave}{\void}
Leave the critical section allowing other threads use the global data protected
by it. There is no error return for this function.