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

📄 vxwtask.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/VXWTask.html - generated by refgen from /vobs/wpwr/docs/vxworks/ref/VXWTask.i --> <title> VXWTask </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Wind Foundation Classes</i></a></p></blockquote><h1>VXWTask</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>VXWTask</strong> - task class</p></blockquote><h4>METHODS</h4><blockquote><p><p><b><i><a href="./VXWTask.html#VXWTask::VXWTask">VXWTask::VXWTask</a></i>(&nbsp;)</b>  -  initialize a task object<br><b><i><a href="./VXWTask.html#VXWTask::VXWTask_1">VXWTask::VXWTask</a></i>(&nbsp;)</b>  -  create and spawn a task<br><b><i><a href="./VXWTask.html#VXWTask::VXWTask_2">VXWTask::VXWTask</a></i>(&nbsp;)</b>  -  initialize a task with a specified stack<br><b><i><a href="./VXWTask.html#VXWTask::~VXWTask">VXWTask::~VXWTask</a></i>(&nbsp;)</b>  -  delete a task<br><b><i><a href="./VXWTask.html#VXWTask::activate">VXWTask::activate</a></i>(&nbsp;)</b>  -  activate a task<br><b><i><a href="./VXWTask.html#VXWTask::deleteForce">VXWTask::deleteForce</a></i>(&nbsp;)</b>  -  delete a task without restriction<br><b><i><a href="./VXWTask.html#VXWTask::envCreate">VXWTask::envCreate</a></i>(&nbsp;)</b>  -  create a private environment<br><b><i><a href="./VXWTask.html#VXWTask::errNo">VXWTask::errNo</a></i>(&nbsp;)</b>  -  retrieve error status value<br><b><i><a href="./VXWTask.html#VXWTask::errNo_1">VXWTask::errNo</a></i>(&nbsp;)</b>  -  set error status value <br><b><i><a href="./VXWTask.html#VXWTask::id">VXWTask::id</a></i>(&nbsp;)</b>  -  reveal task ID <br><b><i><a href="./VXWTask.html#VXWTask::info">VXWTask::info</a></i>(&nbsp;)</b>  -  get information about a task<br><b><i><a href="./VXWTask.html#VXWTask::isReady">VXWTask::isReady</a></i>(&nbsp;)</b>  -  check if task is ready to run<br><b><i><a href="./VXWTask.html#VXWTask::isSuspended">VXWTask::isSuspended</a></i>(&nbsp;)</b>  -  check if task is suspended<br><b><i><a href="./VXWTask.html#VXWTask::kill">VXWTask::kill</a></i>(&nbsp;)</b>  -  send a signal to task<br><b><i><a href="./VXWTask.html#VXWTask::name">VXWTask::name</a></i>(&nbsp;)</b>  -  get the name associated with a task ID<br><b><i><a href="./VXWTask.html#VXWTask::options">VXWTask::options</a></i>(&nbsp;)</b>  -  examine task options<br><b><i><a href="./VXWTask.html#VXWTask::options_1">VXWTask::options</a></i>(&nbsp;)</b>  -  change task options<br><b><i><a href="./VXWTask.html#VXWTask::priority">VXWTask::priority</a></i>(&nbsp;)</b>  -  examine the priority of task<br><b><i><a href="./VXWTask.html#VXWTask::priority_1">VXWTask::priority</a></i>(&nbsp;)</b>  -  change the priority of a task<br><b><i><a href="./VXWTask.html#VXWTask::registers">VXWTask::registers</a></i>(&nbsp;)</b>  -  set a task's registers<br><b><i><a href="./VXWTask.html#VXWTask::registers_1">VXWTask::registers</a></i>(&nbsp;)</b>  -  get task registers from the TCB<br><b><i><a href="./VXWTask.html#VXWTask::restart">VXWTask::restart</a></i>(&nbsp;)</b>  -  restart task<br><b><i><a href="./VXWTask.html#VXWTask::resume">VXWTask::resume</a></i>(&nbsp;)</b>  -  resume task<br><b><i><a href="./VXWTask.html#VXWTask::show">VXWTask::show</a></i>(&nbsp;)</b>  -  display the contents of task registers<br><b><i><a href="./VXWTask.html#VXWTask::show_1">VXWTask::show</a></i>(&nbsp;)</b>  -  display task information from TCBs<br><b><i><a href="./VXWTask.html#VXWTask::sigqueue">VXWTask::sigqueue</a></i>(&nbsp;)</b>  -  send a queued signal to task<br><b><i><a href="./VXWTask.html#VXWTask::SRSet">VXWTask::SRSet</a></i>(&nbsp;)</b>  -  set the task status register (MC680x0, MIPS, i386/i486)<br><b><i><a href="./VXWTask.html#VXWTask::statusString">VXWTask::statusString</a></i>(&nbsp;)</b>  -  get task status as a string<br><b><i><a href="./VXWTask.html#VXWTask::suspend">VXWTask::suspend</a></i>(&nbsp;)</b>  -  suspend task<br><b><i><a href="./VXWTask.html#VXWTask::tcb">VXWTask::tcb</a></i>(&nbsp;)</b>  -  get the task control block<br><b><i><a href="./VXWTask.html#VXWTask::varAdd">VXWTask::varAdd</a></i>(&nbsp;)</b>  -  add a task variable to task<br><b><i><a href="./VXWTask.html#VXWTask::varDelete">VXWTask::varDelete</a></i>(&nbsp;)</b>  -  remove a task variable from task<br><b><i><a href="./VXWTask.html#VXWTask::varGet">VXWTask::varGet</a></i>(&nbsp;)</b>  -  get the value of a task variable<br><b><i><a href="./VXWTask.html#VXWTask::varInfo">VXWTask::varInfo</a></i>(&nbsp;)</b>  -  get a list of task variables<br><b><i><a href="./VXWTask.html#VXWTask::varSet">VXWTask::varSet</a></i>(&nbsp;)</b>  -  set the value of a task variable<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides the interface to the VxWorks task managementfacilities.  This class library provides task control services,programmatic access to task information and debugging features, andhigher-level task information display routines.<p></blockquote><h4>TASK CREATION</h4><blockquote><p>Tasks are created with the constructor <b><i><a href="./VXWTask.html#VXWTask::VXWTask">VXWTask::VXWTask</a></i>(&nbsp;)</b>.  Taskcreation consists of the following:  allocation of memory for the stackand task control block (<b>WIND_TCB</b>), initialization of the <b>WIND_TCB</b>, andactivation of the <b>WIND_TCB</b>.  Special needs may require the use of thelower-level method <b><i><a href="./VXWTask.html#VXWTask::activate">VXWTask::activate</a></i>(&nbsp;)</b>.<p>Tasks in VxWorks execute in the most privileged state of the underlyingarchitecture.  In a shared address space, processor privilege offers noprotection advantages and actually hinders performance.<p>There is no limit to the number of tasks created in VxWorks, as long assufficient memory is available to satisfy allocation requirements.<p></blockquote><h4>TASK DELETION</h4><blockquote><p>If a task exits its "main" routine, specified during task creation,the kernel implicitly calls <b><i><a href="./taskLib.html#exit">exit</a></i>(&nbsp;)</b> to delete the task.  Tasks canbe deleted with the <b><i><a href="./taskLib.html#exit">exit</a></i>(&nbsp;)</b> routine, or explicitly with the <i>delete</i>operator, which arranges to call the class destructor<b><i><a href="./VXWTask.html#VXWTask::~VXWTask">VXWTask::~VXWTask</a></i>(&nbsp;)</b>.<p>Task deletion must be handled with extreme care, due to the inherentdifficulties of resource reclamation.  Deleting a task that owns acritical resource can cripple the system, since the resource may no longerbe available.  Simply returning a resource to an available state is not aviable solution, since the system can make no assumption as to the stateof a particular resource at the time a task is deleted.<p>A task can protect itself from deletion by taking amutual-exclusion semaphore created with the <b>SEM_DELETE_SAFE</b> option(see <b>vxwSemLib</b> for more information).  Many VxWorks system resourcesare protected in this manner, and application designers may wish toconsider this facility where dynamic task deletion is apossibility.<p>The <b><a href="./sigLib.html#top">sigLib</a></b> facility may also be used to allow a task toexecute clean-up code before actually expiring.<p></blockquote><h4>TASK CONTROL</h4><blockquote><p>The following methods control task state: <b><i><a href="./VXWTask.html#VXWTask::resume">VXWTask::resume</a></i>(&nbsp;)</b>,<b><i><a href="./VXWTask.html#VXWTask::suspend">VXWTask::suspend</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::restart">VXWTask::restart</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::priority">VXWTask::priority</a></i>(&nbsp;)</b>,and <b><i><a href="./VXWTask.html#VXWTask::registers">VXWTask::registers</a></i>(&nbsp;)</b>.<p></blockquote><h4>TASK SCHEDULING</h4><blockquote><p>VxWorks schedules tasks on the basis of priority.  Tasks may havepriorities ranging from 0, the highest priority, to 255, the lowestpriority.  The priority of a task in VxWorks is dynamic, and an existingtask's priority can be changed or examined using <b><i>VXWTask:priority</i>(&nbsp;)</b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>taskLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWTask.html#top">VXWTask</a></b>, <b><a href="./taskLib.html#top">taskLib</a></b>, <b><a href="./taskHookLib.html#top">taskHookLib</a></b>, VXWSem,  <b><a href="./kernelLib.html#top">kernelLib</a></b>,  <i>VxWorks Programmer's Guide: Basic OS</i><p><p><hr><a name="VXWTask::VXWTask"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::VXWTask</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::VXWTask</i>(&nbsp;)</strong> - initialize a task object</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>VXWTask    (    int tid    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This constructor creates a task object from the task ID of an existing task.Because of the VxWorks convention that a task ID of 0 refers to the callingtask, this constructor can be used to derive a task object for thecalling task, as follows:<pre>myTask = VXWTask (0);</pre></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b>, <b><i><a href="./VXWTask.html#VXWTask::~VXWTask">VXWTask::~VXWTask</a></i>(&nbsp;)</b>, <b><i><a href="./usrLib.html#sp">sp</a></i>(&nbsp;)</b><hr><a name="VXWTask::VXWTask_1"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::VXWTask</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::VXWTask</i>(&nbsp;)</strong> - create and spawn a task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>VXWTask    (    char *  name,    int     priority,    int     options,    int     stackSize,    FUNCPTR entryPoint,    int     arg1=0,    int     arg2=0,    int     arg3=0,    int     arg4=0,    int     arg5=0,    int     arg6=0,    int     arg7=0,    int     arg8=0,    int     arg9=0,    int     arg10=0    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This constructor creates and activates a new task with a specified priorityand options.<p>A task may be assigned a name as a debugging aid.  This name appearsin displays generated by various system information facilities such as<b><i><a href="./usrLib.html#i">i</a></i>(&nbsp;)</b>.  The name may be of arbitrary length and content, but the currentVxWorks convention is to limit task names to ten characters and prefixthem with a "t".  If <i>name</i> is specified as NULL, an ASCII name isassigned to the task of the form "t<i>n</i>" where <i>n</i> is an integer whichincrements as new tasks are spawned.<p>The only resource allocated to a spawned task is a stack of a specifiedsize <i>stackSize</i>, which is allocated from the system memory partition.Stack size should be an even integer.  A task control block (TCB) iscarved from the stack, as well as any memory required by the task name.The remaining memory is the task's stack and every byte is filled with thevalue 0xEE for the <b><i><a href="./usrLib.html#checkStack">checkStack</a></i>(&nbsp;)</b> facility.  See the manual entry for<b><i><a href="./usrLib.html#checkStack">checkStack</a></i>(&nbsp;)</b> for stack-size checking aids.<p>The entry address <i>entryPt</i> is the address of the "main" routine of the task.The routine is called after the C environment is set up.The specified routine is called with the ten arguments provided.Should the specified main routine return, a call to <b><i><a href="./taskLib.html#exit">exit</a></i>(&nbsp;)</b> ismade automatically.<p>Note that ten (and only ten) arguments must be passed for thespawned function.<p>Bits in the options argument may be set to run with the following modes:<dl><dt><b>VX_FP_TASK</b><dd>execute with floating-point coprocessor support.<p><dt><b>VX_PRIVATE_ENV</b><dd>include private environment support.<p><dt><b>VX_NO_STACK_FILL</b><dd>do not fill the stack for use by <b><i>checkstack</i>(&nbsp;)</b>.<p><dt><b>VX_UNBREAKABLE</b><dd> do not allow breakpoint debugging. </dl><p>See the definitions in <b>taskLib.h</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./VXWTask.html#VXWTask::~VXWTask">VXWTask::~VXWTask</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::activate">VXWTask::activate</a></i>(&nbsp;)</b>, <b><i><a href="./usrLib.html#sp">sp</a></i>(&nbsp;)</b>,  <i>VxWorks Programmer's Guide: Basic OS</i><hr><a name="VXWTask::VXWTask_2"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::VXWTask</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::VXWTask</i>(&nbsp;)</strong> - initialize a task with a specified stack</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>VXWTask    (    WIND_TCB * pTcb,    char *     name,    int        priority,    int        options,    char *     pStackBase,    int        stackSize,    FUNCPTR    entryPoint,    int        arg1=0,    int        arg2=0,    int        arg3=0,    int        arg4=0,    int        arg5=0,    int        arg6=0,    int        arg7=0,    int        arg8=0,    int        arg9=0,    int        arg10=0    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This constructor initializes user-specified regions of memory for a taskstack and control block instead of allocating them from memory.This constructor uses the specified pointers to the <b>WIND_TCB</b>and stack as the components of the task.  This allows, for example, theinitialization of a static <b>WIND_TCB</b> variable.  It also allows for specialstack positioning as a debugging aid.<p>As in other constructors, a task may be given a name.  If no name isspecified, this constructor creates a task without a name (rather than assigning a default name).  <p>Other arguments are the same as in the previous constructor.  Thisconstructor does not activate the task.  This must be done by calling<b><i><a href="./VXWTask.html#VXWTask::activate">VXWTask::activate</a></i>(&nbsp;)</b>.<p>Normally, tasks should be started using the previous constructor ratherthan this one,except when additional control is required for task memory allocation ora separate task activation is desired.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task cannot be initialized.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><i><a href="./VXWTask.html#VXWTask::activate">VXWTask::activate</a></i>(&nbsp;)</b><hr><a name="VXWTask::~VXWTask"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes :  Methods</i></a></p></blockquote><h1><i>VXWTask::~VXWTask</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>VXWTask::~VXWTask</i>(&nbsp;)</strong> - delete a task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>    virtual ~VXWTask ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This destructor causes the task to cease to exist and deallocates thestack and <b>WIND_TCB</b> memory resources.  Upon deletion, all routines specifiedby <b><i><a href="./taskHookLib.html#taskDeleteHookAdd">taskDeleteHookAdd</a></i>(&nbsp;)</b> are called in the context of the deleting task.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excLib.html#top">excLib</a></b>, <b><i><a href="./taskHookLib.html#taskDeleteHookAdd">taskDeleteHookAdd</a></i>(&nbsp;)</b>, <b><i><a href="./VXWTask.html#VXWTask::VXWTask">VXWTask::VXWTask</a></i>(&nbsp;)</b>,  <i>VxWorks Programmer's Guide: Basic OS</i><hr><a name="VXWTask::activate"></a><p align=right>

⌨️ 快捷键说明

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