📄 semevlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/semEvLib.html - generated by refgen from semEvLib.c --> <title> semEvLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>semEvLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>semEvLib</strong> - VxWorks events support for semaphores </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./semEvLib.html#semEvStart">semEvStart</a>( )</b> - start event notification process for a semaphore<br><b><a href="./semEvLib.html#semEvStop">semEvStop</a>( )</b> - stop event notification process for a semaphore<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p>This library is an extension to <b><a href="./eventLib.html#top">eventLib</a></b>, the events library. Its purpose is to support events for semaphores.<p>The functions in this library are used to control registration of tasks on asemaphore. The routine <b><a href="./semEvLib.html#semEvStart">semEvStart</a>( )</b> registers a task and starts thenotification process. The function <b><a href="./semEvLib.html#semEvStop">semEvStop</a>( )</b> un-registers the task, which stops the notification mechanism.<p>When a task is registered and the semaphore becomes available, the eventsspecified are sent to that task. However, if a <b><a href="./semLib.html#semTake">semTake</a>( )</b> is to be doneafterwards, there is no guarantee that the semaphore will still be available. <p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>semEvLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./eventLib.html#top">eventLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>,<i>VxWorks Programmer's Guide: Basic OS </i><hr><a name="semEvStart"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>semEvStart( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>semEvStart( )</strong> - start event notification process for a semaphore</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS semEvStart ( SEM_ID semId, /* semaphore on which to register events */ UINT32 events, /* 32 possible events to register */ UINT8 options /* event-related semaphore options */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine turns on the event notification process for a given semaphore.When the semaphore becomes available but no task is pending on it, the events specified will be sent to the task registered by this function.A task can overwrite its own registration without first invoking <b><a href="./semEvLib.html#semEvStop">semEvStop</a>( )</b>or specifying the <b>ALLOW_OVERWRITE</b> option.<p>The <i>option</i> parameter is used for 3 user options:- Specify if the events are to be sent only once or every time the semaphore is free until <b><a href="./semEvLib.html#semEvStop">semEvStop</a>( )</b> is called. The option <dl><dt><b>EVENTS_SEND_ONCE</b> (0x1)<dd>tells the semaphore to send the events one time only.- Specify if another task can register itself while the current task isstill registered. If so, the current task registration is overwritten withoutany warning. The option <dt><b>EVENTS_ALLOW_OVERWRITE</b> (0x2)<dd>allows subsequent registrations to overwrite the current one.- Specify if events are to be sent at the time of the registration in thecase the semaphore is free. The option<dt><b>EVENTS_SEND_IF_FREE</b> (0x4)<dd>tells the registration process to send events if the semaphore is free.If none of these options are to be used, the option<dt><b>EVENTS_OPTIONS_NONE</b><dd>has to be passed to the <i>options</i> parameter.</dl></blockquote><h4>WARNING</h4><blockquote><p>This routine cannot be called from interrupt level.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK on success, or ERROR.<p></blockquote><h4>ERRNO</h4><blockquote><p><dl><dt><b>S_objLib_OBJ_ID_ERROR</b><dd>The semaphore ID is invalid.<dt><b>S_eventLib_ALREADY_REGISTERED</b><dd>A task is already registered on the semaphore.<dt><b>S_intLib_NOT_ISR_CALLABLE</b><dd>Routine has been called from interrupt level.<dt><b>S_eventLib_EVENTSEND_FAILED</b><dd>User chose to send events right away and that operation failed.<dt><b>S_eventLib_ZERO_EVENTS</b><dd>User passed in a value of zero to the <i>events</i> parameter.</dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./semEvLib.html#top">semEvLib</a></b>, <b><a href="./eventLib.html#top">eventLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>, <b><a href="./semEvLib.html#semEvStop">semEvStop</a>( )</b><hr><a name="semEvStop"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>semEvStop( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>semEvStop( )</strong> - stop event notification process for a semaphore</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS semEvStop ( SEM_ID semId )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine turns off the event notification process for a given semaphore.It thus allows another task to register itself for event notification onthat particular semaphore.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK on success, or ERROR.<p></blockquote><h4>ERRNO</h4><blockquote><p><dl><dt><b>S_objLib_OBJ_ID_ERROR</b><dd>The semaphore ID is invalid.<dt><b>S_intLib_NOT_ISR_CALLABLE</b><dd>Routine has been called at interrupt level.<dt><b>S_eventLib_TASK_NOT_REGISTERED</b><dd>Routine has not been called by the registered task.</dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./semEvLib.html#top">semEvLib</a></b>, <b><a href="./eventLib.html#top">eventLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>, <b><a href="./semEvLib.html#semEvStart">semEvStart</a>( )</b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -