pthreadlib.html
来自「Vxworks API操作系统和驱动程序设计API。压缩的HTML文件」· HTML 代码 · 共 1,229 行 · 第 1/5 页
HTML
1,229 行
</blockquote><h1>pthread_mutex_setprioceiling( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pthread_mutex_setprioceiling( )</strong> - dynamically set the prioceiling attribute of a mutex (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int pthread_mutex_setprioceiling ( pthread_mutex_t * pMutex, /* POSIX mutex */ int prioceiling, /* new priority ceiling */ int * pOldPrioceiling /* old priority ceiling (out) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function dynamically sets the value of the prioceiling attribute of amutex. Unless the mutex was created with a protocol value of<b>PTHREAD_PRIO_PROTECT</b>, this function does nothing.<p></blockquote><h4>RETURNS</h4><blockquote><p>On success zero; on failure a non-zero error code.<p></blockquote><h4>ERRNOS</h4><blockquote><p><b>EINVAL</b>, <b>EPERM</b>, <b>S_objLib_OBJ_ID_ERROR</b>, <b>S_semLib_NOT_ISR_CALLABLE</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pthreadLib.html#top">pthreadLib</a></b>, <b><a href="./pthreadLib.html#pthread_mutex_getprioceiling">pthread_mutex_getprioceiling</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutexattr_getprioceiling">pthread_mutexattr_getprioceiling</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutexattr_setprioceiling">pthread_mutexattr_setprioceiling</a>( )</b><hr><a name="pthread_mutex_init"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>pthread_mutex_init( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pthread_mutex_init( )</strong> - initialize mutex from attributes object (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int pthread_mutex_init ( pthread_mutex_t * pMutex, /* POSIX mutex */ const pthread_mutexattr_t * pAttr /* mutex attributes */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the mutex object pointed to by <i>pMutex</i> accordingto the mutex attributes specified in <i>pAttr</i>. If <i>pAttr</i> is NULL, defaultattributes are used as defined in the POSIX specification.<p></blockquote><h4>RETURNS</h4><blockquote><p>On success zero; on failure a non-zero error code.<p></blockquote><h4>ERRNOS</h4><blockquote><p><b>EINVAL</b>, <b>EBUSY</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pthreadLib.html#top">pthreadLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>, <b><a href="./semMLib.html#top">semMLib</a></b>, <b><a href="./pthreadLib.html#pthread_mutex_destroy">pthread_mutex_destroy</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_lock">pthread_mutex_lock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_trylock">pthread_mutex_trylock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_unlock">pthread_mutex_unlock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutexattr_init">pthread_mutexattr_init</a>( )</b>, <b><a href="./semMLib.html#semMCreate">semMCreate</a>( )</b><hr><a name="pthread_mutex_destroy"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>pthread_mutex_destroy( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pthread_mutex_destroy( )</strong> - destroy a mutex (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int pthread_mutex_destroy ( pthread_mutex_t * pMutex /* POSIX mutex */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine destroys a mutex object, freeing the resources it might hold.The mutex must be unlocked when this function is called, otherwise it willreturn an error (<b>EBUSY</b>).<p></blockquote><h4>RETURNS</h4><blockquote><p>On success zero; on failure a non-zero error code.<p></blockquote><h4>ERRNOS</h4><blockquote><p><b>EINVAL</b>, <b>EBUSY</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pthreadLib.html#top">pthreadLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>, <b><a href="./semMLib.html#top">semMLib</a></b>, <b><a href="./pthreadLib.html#pthread_mutex_init">pthread_mutex_init</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_lock">pthread_mutex_lock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_trylock">pthread_mutex_trylock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_unlock">pthread_mutex_unlock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutexattr_init">pthread_mutexattr_init</a>( )</b>, <b><a href="./semLib.html#semDelete">semDelete</a>( )</b><hr><a name="pthread_mutex_lock"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>pthread_mutex_lock( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pthread_mutex_lock( )</strong> - lock a mutex (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int pthread_mutex_lock ( pthread_mutex_t * pMutex /* POSIX mutex */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine locks the mutex specified by <i>pMutex</i>. If the mutex iscurrently unlocked, it becomes locked, and is said to be owned by thecalling thread. In this case <b><a href="./pthreadLib.html#pthread_mutex_lock">pthread_mutex_lock</a>( )</b> returns immediately.<p>If the mutex is already locked by another thread, <b><a href="./pthreadLib.html#pthread_mutex_lock">pthread_mutex_lock</a>( )</b>blocks the calling thread until the mutex is unlocked by its current owner.<p>If it is already locked by the calling thread, <b>pthread_mutex_lock</b> willdeadlock on itself and the thread will block indefinitely.<p></blockquote><h4>RETURNS</h4><blockquote><p>On success zero; on failure a non-zero error code.<p></blockquote><h4>ERRNOS</h4><blockquote><p><b>EINVAL</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pthreadLib.html#top">pthreadLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>, <b><a href="./semMLib.html#top">semMLib</a></b>, <b><a href="./pthreadLib.html#pthread_mutex_init">pthread_mutex_init</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_lock">pthread_mutex_lock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_trylock">pthread_mutex_trylock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_unlock">pthread_mutex_unlock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutexattr_init">pthread_mutexattr_init</a>( )</b>, <b><a href="./semLib.html#semTake">semTake</a>( )</b><hr><a name="pthread_mutex_trylock"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>pthread_mutex_trylock( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pthread_mutex_trylock( )</strong> - lock mutex if it is available (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int pthread_mutex_trylock ( pthread_mutex_t * pMutex /* POSIX mutex */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine locks the mutex specified by <i>pMutex</i>. If the mutex iscurrently unlocked, it becomes locked and owned by the calling thread. Inthis case <b><a href="./pthreadLib.html#pthread_mutex_trylock">pthread_mutex_trylock</a>( )</b> returns immediately.<p>If the mutex is already locked by another thread, <b><a href="./pthreadLib.html#pthread_mutex_trylock">pthread_mutex_trylock</a>( )</b>returns immediately with the error code <b>EBUSY</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>On success zero; on failure a non-zero error code.<p></blockquote><h4>ERRNOS</h4><blockquote><p><b>EINVAL</b>, <b>EBUSY</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pthreadLib.html#top">pthreadLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>, <b><a href="./semMLib.html#top">semMLib</a></b>, <b><a href="./pthreadLib.html#pthread_mutex_init">pthread_mutex_init</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_lock">pthread_mutex_lock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_trylock">pthread_mutex_trylock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_unlock">pthread_mutex_unlock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutexattr_init">pthread_mutexattr_init</a>( )</b>, <b><a href="./semLib.html#semTake">semTake</a>( )</b><hr><a name="pthread_mutex_unlock"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>pthread_mutex_unlock( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pthread_mutex_unlock( )</strong> - unlock a mutex (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int pthread_mutex_unlock ( pthread_mutex_t * pMutex )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine unlocks the mutex specified by <i>pMutex</i>. If the calling threadis not the current owner of the mutex, <b><a href="./pthreadLib.html#pthread_mutex_unlock">pthread_mutex_unlock</a>( )</b> returns withthe error code <b>EPERM</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>On success zero; on failure a non-zero error code.<p></blockquote><h4>ERRNOS</h4><blockquote><p><b>EINVAL</b>, <b>EPERM</b>, <b>S_objLib_OBJ_ID_ERROR</b>, <b>S_semLib_NOT_ISR_CALLABLE</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pthreadLib.html#top">pthreadLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>, <b><a href="./semMLib.html#top">semMLib</a></b>, <b><a href="./pthreadLib.html#pthread_mutex_init">pthread_mutex_init</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_lock">pthread_mutex_lock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_trylock">pthread_mutex_trylock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutex_unlock">pthread_mutex_unlock</a>( )</b>, <b><a href="./pthreadLib.html#pthread_mutexattr_init">pthread_mutexattr_init</a>( )</b>, <b><a href="./semLib.html#semGive">semGive</a>( )</b><hr><a name="pthread_condattr_init"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>pthread_condattr_init( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pthread_condattr_init( )</strong> - initialize a condition attribute object (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int pthread_condattr_init ( pthread_condattr_t * pAttr /* condition variable attributes */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the condition attribute object <i>pAttr</i> and fillsit with default values for the attributes.<p></blockquote><h4>RETURNS</h4><blockquote><p>On success zero; on failure a non-zero error code.<p></blockquote><h4>ERRNOS</h4><blockquote><p><b>EINVAL</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pthreadLib.html#top">pthreadLib</a></b>, <b><a href="./pthreadLib.html#pthread_cond_init">pthread_cond_init</a>( )</b>, <b><a href="./pthreadLib.html#pthread_condattr_destroy">pthread_condattr_destroy</a>( )</b><hr><a name="pthread_condattr_destroy"></a><p align=right>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?