📄 wylock.3wy
字号:
.\".\" Edited by I.J.Wang, 2004.\".TH WyLock 3wy "libwy v0.31".SH NAMEWyLock \- class for locking and unlocking WyMutex.SH SYNOPSIS.B #include <wymutex.h>.PPWyLock locks the given WyMutex on construction, unlocks the mutex while the execution leaves scope (or the thread is cancelled).WyLock object should only be accessed by one thread.A purpose of WyLock is when used locally with WyCond::wait(..), becauseWyCond::wait(..) is a cancellation point, placingWyLock in the same scope makes sure the mutex is unlockedwhile cancellation occurres.For example: WyMutex mtx; ... { WyLock aa(mtx); // lock mtx .... } ... // mtx is unlocked.SH "PUBLIC MEMBERS" class \fBReply\fP : public WyRet \fBWyLock\fP(WyMutex&) throw(Reply) \fB~WyLock\fP() throw() WyRet \fBxlock\fP(WyMutex&).SH "DESCRIPTION".\"--------------------------------------------.PP.BI "class Reply : public WyRet".PP Class specific throw type.\"--------------------------------------------.PP.BI "WyLock(WyMutex& " "mtx" ") throw(Reply)".PP Construct object and lock the given mutex \fImtx\fP.PP [\fBThrow\fP] Reply Wym_EDEADLK (\fBErrorCheck\fP type of mutex only) \fImtx\fP already locked by the calling thread.PP [\fBRefer\fP] WyMutex::lock.\"--------------------------------------------.PP.BI "~WyLock() throw()".PP Unlock the handling mutex and destruct *this.PP [\fBRefer\fP] WyMutex::unlock.\"--------------------------------------------.PP.BI "WyRet xlock(WyMutex& " "mtx" ")".PP Lock mutex \fImtx\fP, then unlock the previously handled mutex..PP [\fBRet\fP] Ok Succeed Wym_EDEADLK (\fBErrorCheck\fP type of mutex only) \fImtx\fP already locked by the calling thread.PP [\fBRefer\fP] WyMutex::(un)lock.\"--------------------------------------------.SH "SEE ALSO".BR wyret.BR wyreply.BR wymutex.BR wycond.BR wyonce.BR wytimespec.BR wy_thread.SH NOTEExcept added by this library, replys are converted from the errno an underlying C library function returned. Report of such replysare brief from Linux Programmer's Manual. See the associated man pagefor details.Project is in development, http://sourceforge.net/projects/libwx
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -