.\" This is a wxWidgets manpage page generated from the XML docs .TH wxCriticalSection 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxCriticalSection \- Critical section class .SH DESCRIPTION A critical section object is used for exactly the same purpose as mutexes . 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 wxCriticalSectionLocker class whenever possible instead of directly using wxCriticalSection for the same reasons wxMutexLocker is preferrable to wxMutex - please see wxMutex for an example. .SH "PARENTS" .SH "INCLUDE FILES" wx/thread.h .SH MEMBERS .SS wxCriticalSection () Default constructor initializes critical section object. .SS ~wxCriticalSection () Destructor frees the resources. .SS void Enter () 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. .SS void Leave () Leave the critical section allowing other threads use the global data protected by it. There is no error return for this function. .SH "SEE ALSO" wxThread wxCondition wxCriticalSectionLocker .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.