⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 critsect.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
字号:
\section{\class{wxCriticalSection}}\label{wxcriticalsection}A critical section object is used for exactly the same purpose as \helpref{mutexes}{wxmutex}. The only difference is that under Windows platformcritical sections are only visible inside one process, while mutexes may beshared between processes, so using critical sections is slightly moreefficient. The terminology is also slightly different: mutex may be locked (oracquired) and unlocked (or released) while critical section is entered and leftby the program.Finally, you should try to use \helpref{wxCriticalSectionLocker}{wxcriticalsectionlocker} class wheneverpossible 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{Include files}<wx/thread.h>\wxheading{See also}\helpref{wxThread}{wxthread}, \helpref{wxCondition}{wxcondition}, \helpref{wxCriticalSectionLocker}{wxcriticalsectionlocker}\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 resources.\membersection{wxCriticalSection::Enter}\label{wxcriticalsectionenter}\func{void }{Enter}{\void}Enter the critical section (same as locking a mutex). There is no error returnfor this function. After entering the critical section protecting some globaldata 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 protectedby it. There is no error return for this function.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -