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

📄 vxwtask.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<pre>STATUS SRSet    (    UINT32 sr    )</pre>This routine sets the status register of a task that is not running;that is, you must not call this-><b><i>SRSet</i>(&nbsp;)</b>.Debugging facilities use this routine to set the trace bit in the status register of a task that is being single-stepped.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWTask.html#top">VXWTask</a></b><hr><a name="VXWTask::statusString"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::statusString</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::statusString</i>(&nbsp;)</strong> - get task status as a string</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS statusString    (    char * pString    ) const</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deciphers the WIND task status word in the TCB for itstask, and copies the appropriate string to <i>pString</i>.<p>The formatted string is one of the following:<p><table><tr valign=top><th align=left>String   </th><th align=left> Meaning</tr><tr><td colspan="2"><hr></tr><tr valign=top><td align=left>READY    </td><td align=left> Task is not waiting for any resource other than the CPU.</tr><tr valign=top><td align=left>PEND     </td><td align=left> Task is blocked due to the unavailability of some resource.</tr><tr valign=top><td align=left>DELAY    </td><td align=left> Task is asleep for some duration.</tr><tr valign=top><td align=left>SUSPEND  </td><td align=left> Task is unavailable for execution (but not suspended, delayed, or pended).</tr><tr valign=top><td align=left>DELAY+S  </td><td align=left> Task is both delayed and suspended.</tr><tr valign=top><td align=left>PEND+S   </td><td align=left> Task is both pended and suspended.</tr><tr valign=top><td align=left>PEND+T   </td><td align=left> Task is pended with a timeout.</tr><tr valign=top><td align=left>PEND+S+T </td><td align=left> Task is pended with a timeout, and also suspended.</tr><tr valign=top><td align=left>...+I  </td><td align=left> Task has inherited priority (+I may be appended to any string above).</tr><tr valign=top><td align=left>DEAD     </td><td align=left> Task no longer exists.</tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>RETURNS</h4><blockquote><p>OK.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWTask.html#top">VXWTask</a></b><hr><a name="VXWTask::suspend"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::suspend</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::suspend</i>(&nbsp;)</strong> - suspend task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>    STATUS suspend ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine suspends its task.  Suspension is additive:  thus, taskscan be delayed and suspended, or pended and suspended.  Suspended, delayedtasks whose delays expire remain suspended.  Likewise, suspended,pended tasks that unblock remain suspended only.<p>Care should be taken with asynchronous use of this facility.  The task is suspended regardless of its current state.  The task could, forinstance, have mutual exclusion to some system resource, such as the networkor system memory partition.  If suspended during such a time, the facilitiesengaged are unavailable, and the situation often ends in deadlock.<p>This routine is the basis of the debugging and exception handling packages.However, as a synchronization mechanism, this facility should be rejected in favor of the more general semaphore facility.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task cannot be suspended.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWTask.html#top">VXWTask</a></b><hr><a name="VXWTask::tcb"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::tcb</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::tcb</i>(&nbsp;)</strong> - get the task control block</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>    WIND_TCB * tcb ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns a pointer to the task control block (<b>WIND_TCB</b>) forits 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="./VXWTask.html#VXWTask::registers">VXWTask::registers</a></i>(&nbsp;)</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to a <b>WIND_TCB</b>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWTask.html#top">VXWTask</a></b><hr><a name="VXWTask::varAdd"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::varAdd</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::varAdd</i>(&nbsp;)</strong> - add a task variable to task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS varAdd    (    int * pVar    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a specified variable <i>pVar</i> (4-byte memory location) toits task's context.  After calling this routine, the variable isprivate to the task.  The task can access and modify the variable, butthe modifications are not visible to other tasks, and other tasks'modifications to that variable do not affect the value seen by thetask.  This is accomplished by saving and restoring the variable's initialvalue each time a task switch occurs to or from the calling task.<p>This facility can be used when a routine is to be spawned repeatedly asseveral independent tasks.  Although each task has its own stack,and thus separate stack variables, they all share the same static andglobal variables.  To make a variable <i>not</i> shareable, the routine cancall <b><i><a href="./VXWTask.html#VXWTask::varAdd">VXWTask::varAdd</a></i>(&nbsp;)</b> to make a separate copy of the variable for eachtask, but all at the same physical address.<p>Note that task variables increase the task switch time to and from thetasks that own them.  Therefore, it is desirable to limit the number oftask variables that a task uses.  One efficient way to use task variables is to have a single task variable that is a pointer to a dynamically allocated structure containing the task's private data.<p></blockquote><h4>EXAMPLE</h4><blockquote><p><p>Assume that three identical tasks are spawned with a main routine called<i><b><i>operator</i>(&nbsp;)</b></i>.  All three use the structure <b>OP_GLOBAL</b> for all variablesthat are specific to a particular incarnation of the task.  The followingcode fragment shows how this is set up:<p><pre>OP_GLOBAL *opGlobal;  // ptr to operator task's global variablesVXWTask   me;         // task object for selfvoid operator    (    int opNum         // number of this operator task     )    {    me = VXWTask (0); // task object for running task    if (me.varAdd ((int *)&amp;opGlobal) != OK)        {        printErr ("operator%d: can't VXWTask::varAdd opGlobal\n", opNum);        me.suspend ();        }    if ((opGlobal = (OP_GLOBAL *) malloc (sizeof (OP_GLOBAL))) == NULL)        {        printErr ("operator%d: can't malloc opGlobal\n", opNum);        me.suspend ();        }    ...    }</pre></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if memory is insufficient for the task variable descriptor.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./VXWTask.html#VXWTask::varDelete">VXWTask::varDelete</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::varGet">VXWTask::varGet</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::varSet">VXWTask::varSet</a></i>(&nbsp;)</b><hr><a name="VXWTask::varDelete"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::varDelete</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::varDelete</i>(&nbsp;)</strong> - remove a task variable from task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS varDelete    (    int * pVar    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes a specified task variable, <i>pVar</i>, from itstask's context.  The private value of that variable is lost.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, orERROR if the task variable does not exist for the task.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./VXWTask.html#VXWTask::varAdd">VXWTask::varAdd</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::varGet">VXWTask::varGet</a></i>(&nbsp;)</b>, <b><i>VXWTask:varSet</i>(&nbsp;)</b><hr><a name="VXWTask::varGet"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::varGet</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::varGet</i>(&nbsp;)</strong> - get the value of a task variable</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int varGet    (    int * pVar    ) const</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the private value of a task variable for itstask.  The task is usually not the calling task,which can get its private value by directly accessing the variable.This routine is provided primarily for debugging purposes.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The private value of the task variable, orERROR if the task does not own the task variable.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./VXWTask.html#VXWTask::varAdd">VXWTask::varAdd</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::varDelete">VXWTask::varDelete</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::varSet">VXWTask::varSet</a></i>(&nbsp;)</b><hr><a name="VXWTask::varInfo"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::varInfo</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::varInfo</i>(&nbsp;)</strong> - get a list of task variables</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int varInfo    (    TASK_VAR varList[],    int      maxVars    ) const</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine provides the calling task with a list of all of the taskvariables of its task.  The unsorted array of task variables iscopied to <i>varList</i>.<p></blockquote><h4>CAVEATS</h4><blockquote><p>Kernel rescheduling is disabled while task variables arelooked up.  <p>There is no guarantee that all the task variables are stillvalid or that new task variables have not been created by the time thisroutine returns.<p></blockquote><h4>RETURNS</h4><blockquote><p>The number of task variables in the list.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWTask.html#top">VXWTask</a></b><hr><a name="VXWTask::varSet"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::varSet</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::varSet</i>(&nbsp;)</strong> - set the value of a task variable</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS varSet    (    int * pVar,    int   value    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the private value of the task variable for a specifiedtask.  The specified task is usually not the calling task, which can setits private value by directly modifying the variable.  This routine isprovided primarily for debugging purposes.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the task does not own the task variable.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./VXWTask.html#VXWTask::varAdd">VXWTask::varAdd</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::varDelete">VXWTask::varDelete</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::varGet">VXWTask::varGet</a></i>(&nbsp;)</b></body></html>

⌨️ 快捷键说明

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