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

📄 tasklib.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 3 页
字号:
</blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskPriorityGet    (    int   tid,      /* task ID */    int * pPriority /* return priority here */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine determines the current priority of a specified task.The current priority is copied to the integer pointed to by <i>pPriority</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task ID is invalid.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_objLib_OBJ_ID_ERROR<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b>, <b><i><a href="./taskLib.html#taskPrioritySet">taskPrioritySet</a></i>(&nbsp;)</b><hr><a name="taskLock"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>taskLock</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>taskLock</i>(&nbsp;)</strong> - disable task rescheduling</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskLock (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine disables task context switching.  The task that calls thisroutine will be the only task that is allowed to execute, unless the taskexplicitly gives up the CPU by making itself no longer ready.  Typicallythis call is paired with <b><i><a href="./taskLib.html#taskUnlock">taskUnlock</a></i>(&nbsp;)</b>; together they surround a criticalsection of code.  These preemption locks are implemented with a countingvariable that allows nested preemption locks.  Preemption will not beunlocked until <b><i><a href="./taskLib.html#taskUnlock">taskUnlock</a></i>(&nbsp;)</b> has been called as many times as <b><i><a href="./taskLib.html#taskLock">taskLock</a></i>(&nbsp;)</b>.<p>This routine does not lock out interrupts; use <b><i><a href="./intArchLib.html#intLock">intLock</a></i>(&nbsp;)</b> to lock outinterrupts.<p>A <b><i><a href="./taskLib.html#taskLock">taskLock</a></i>(&nbsp;)</b> is preferable to <b><i><a href="./intArchLib.html#intLock">intLock</a></i>(&nbsp;)</b> as a means of mutual exclusion,because interrupt lock-outs add interrupt latency to the system.<p>A <b><i><a href="./semLib.html#semTake">semTake</a></i>(&nbsp;)</b> is preferable to <b><i><a href="./taskLib.html#taskLock">taskLock</a></i>(&nbsp;)</b> as a means of mutual exclusion,because preemption lock-outs add preemptive latency to the system.<p>The <b><i><a href="./taskLib.html#taskLock">taskLock</a></i>(&nbsp;)</b> routine is not callable from interrupt service routines.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_objLib_OBJ_ID_ERROR, S_intLib_NOT_ISR_CALLABLE<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b>, <b><i><a href="./taskLib.html#taskUnlock">taskUnlock</a></i>(&nbsp;)</b>, <b><i><a href="./intArchLib.html#intLock">intLock</a></i>(&nbsp;)</b>, <b><i><a href="./taskLib.html#taskSafe">taskSafe</a></i>(&nbsp;)</b>, <b><i><a href="./semLib.html#semTake">semTake</a></i>(&nbsp;)</b><hr><a name="taskUnlock"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>taskUnlock</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>taskUnlock</i>(&nbsp;)</strong> - enable task rescheduling</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskUnlock (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine decrements the preemption lock count.  Typically this call ispaired with <b><i><a href="./taskLib.html#taskLock">taskLock</a></i>(&nbsp;)</b> and concludes a critical section of code.Preemption will not be unlocked until <b><i><a href="./taskLib.html#taskUnlock">taskUnlock</a></i>(&nbsp;)</b> has been called as manytimes as <b><i><a href="./taskLib.html#taskLock">taskLock</a></i>(&nbsp;)</b>.  When the lock count is decremented to zero, any tasksthat were eligible to preempt the current task will execute.<p>The <b><i><a href="./taskLib.html#taskUnlock">taskUnlock</a></i>(&nbsp;)</b> routine is not callable from interrupt service routines.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_intLib_NOT_ISR_CALLABLE<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b>, <b><i><a href="./taskLib.html#taskLock">taskLock</a></i>(&nbsp;)</b><hr><a name="taskSafe"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>taskSafe</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>taskSafe</i>(&nbsp;)</strong> - make the calling task safe from deletion</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskSafe (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine protects the calling task from deletion.  Tasks that attemptto delete a protected task will block until the task is made unsafe, using<b><i><a href="./taskLib.html#taskUnsafe">taskUnsafe</a></i>(&nbsp;)</b>.  When a task becomes unsafe, the deleter will be unblockedand allowed to delete the task.<p>The <b><i><a href="./taskLib.html#taskSafe">taskSafe</a></i>(&nbsp;)</b> primitive utilizes a count to keep track of nestedcalls for task protection.  When nesting occurs, the taskbecomes unsafe only after the outermost <b><i><a href="./taskLib.html#taskUnsafe">taskUnsafe</a></i>(&nbsp;)</b> is executed.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b>, <b><i><a href="./taskLib.html#taskUnsafe">taskUnsafe</a></i>(&nbsp;)</b>,  <i>VxWorks Programmer's Guide: Basic OS</i><hr><a name="taskUnsafe"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>taskUnsafe</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>taskUnsafe</i>(&nbsp;)</strong> - make the calling task unsafe from deletion</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskUnsafe (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes the calling task's protection from deletion.  Tasksthat attempt to delete a protected task will block until the task is unsafe.When a task becomes unsafe, the deleter will be unblocked and allowed todelete the task.<p>The <b><i><a href="./taskLib.html#taskUnsafe">taskUnsafe</a></i>(&nbsp;)</b> primitive utilizes a count to keep track of nestedcalls for task protection.  When nesting occurs, the taskbecomes unsafe only after the outermost <b><i><a href="./taskLib.html#taskUnsafe">taskUnsafe</a></i>(&nbsp;)</b> is executed.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b>, <b><i><a href="./taskLib.html#taskSafe">taskSafe</a></i>(&nbsp;)</b>,  <i>VxWorks Programmer's Guide: Basic OS</i><hr><a name="taskDelay"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>taskDelay</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>taskDelay</i>(&nbsp;)</strong> - delay a task from executing</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskDelay    (    int ticks /* number of ticks to delay task */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine causes the calling task to relinquish the CPU for the durationspecified (in ticks).  This is commonly referred to as manual rescheduling,but it is also useful when waiting for some external condition that does nothave an interrupt associated with it.<p>If the calling task receives a signal that is not being blocked or ignored,<b><i><a href="./taskLib.html#taskDelay">taskDelay</a></i>(&nbsp;)</b> returns ERROR and sets <b>errno</b> to EINTR after the signalhandler is run.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if called from interrupt level or if the calling taskreceives a signal that is not blocked or ignored.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_intLib_NOT_ISR_CALLABLE, EINTR</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b><hr><a name="taskIdSelf"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>taskIdSelf</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>taskIdSelf</i>(&nbsp;)</strong> - get the task ID of a running task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int taskIdSelf (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the task ID of the calling task.  The task ID will beinvalid if called at interrupt level.<p></blockquote><h4>RETURNS</h4><blockquote><p>The task ID of the calling task.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b><hr><a name="taskIdVerify"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>taskIdVerify</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>taskIdVerify</i>(&nbsp;)</strong> - verify the existence of a task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskIdVerify    (    int tid /* task ID */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine verifies the existence of a specified task by validating thespecified ID as a task ID.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task ID is invalid.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_objLib_OBJ_ID_ERROR</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b><hr><a name="taskTcb"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>taskTcb</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>taskTcb</i>(&nbsp;)</strong> - get the task control block for a task ID</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>WIND_TCB *taskTcb    (    int tid /* task ID */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns a pointer to the task control block (<b>WIND_TCB</b>) for aspecified task.  Although all task state information is contained in theTCB, users must not modify it directly.  To change registers, for instance,use <b><i><a href="./taskInfo.html#taskRegsSet">taskRegsSet</a></i>(&nbsp;)</b> and <b><i><a href="./taskInfo.html#taskRegsGet">taskRegsGet</a></i>(&nbsp;)</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to a <b>WIND_TCB</b>, or NULL if the task ID is invalid.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_objLib_OBJ_ID_ERROR</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b></body></html>

⌨️ 快捷键说明

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