mutexlck.tex

来自「wxWidgets 是一个跨平台的 GUI 框架。它给开发人员提供了统一的接口」· TEX 代码 · 共 44 行

TEX
44
字号
\section{\class{wxMutexLocker}}\label{wxmutexlocker}This is a small helper class to be used with \helpref{wxMutex}{wxmutex} objects. A wxMutexLocker acquires a mutex lock in the constructor and releases(or unlocks) the mutex in the destructor making it much more difficult toforget to release a mutex (which, in general, will promptly lead to seriousproblems). See \helpref{wxMutex}{wxmutex} for an example of wxMutexLockerusage.\wxheading{Derived from}None.\wxheading{Include files}<wx/thread.h>\wxheading{See also}\helpref{wxMutex}{wxmutex}, \helpref{wxCriticalSectionLocker}{wxcriticalsectionlocker}\latexignore{\rtfignore{\wxheading{Members}}}\membersection{wxMutexLocker::wxMutexLocker}\label{wxmutexlockerctor}\func{}{wxMutexLocker}{\param{wxMutex\&}{ mutex}}Constructs a wxMutexLocker object associated with mutex and locks it.Call \helpref{IsLocked}{wxmutexlockerisok} to check if the mutex wassuccessfully locked.\membersection{wxMutexLocker::\destruct{wxMutexLocker}}\label{wxmutexlockerdtor}\func{}{\destruct{wxMutexLocker}}{\void}Destructor releases the mutex if it was successfully acquired in the ctor.\membersection{wxMutexLocker::IsOk}\label{wxmutexlockerisok}\constfunc{bool}{IsOk}{\void}Returns true if mutex was acquired in the constructor, false otherwise.

⌨️ 快捷键说明

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