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

📄 int8u ostaskdelreq.htm

📁 uCOS-II系统服务例程 很不错的内核代码解释
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=GB2312">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./INT8U%20OSTaskDelReq.files/filelist.xml">
<title> </title>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>halex</o:Author>
  <o:Revision>1</o:Revision>
  <o:TotalTime>0</o:TotalTime>
  <o:Created>2003-05-25T16:51:00Z</o:Created>
  <o:Pages>1</o:Pages>
  <o:Words>446</o:Words>
  <o:Characters>2544</o:Characters>
  <o:Company>lab706</o:Company>
  <o:Lines>21</o:Lines>
  <o:Paragraphs>5</o:Paragraphs>
  <o:CharactersWithSpaces>3124</o:CharactersWithSpaces>
  <o:Version>9.2812</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:DoNotOptimizeForBrowser/>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
@font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
h1
	{mso-style-next:正文;
	margin-top:17.0pt;
	margin-right:0cm;
	margin-bottom:16.5pt;
	margin-left:0cm;
	text-align:justify;
	text-justify:inter-ideograph;
	line-height:240%;
	mso-pagination:lines-together;
	page-break-after:avoid;
	mso-outline-level:1;
	font-size:22.0pt;
	font-family:"Times New Roman";
	mso-font-kerning:22.0pt;}
p.CodeSeg, li.CodeSeg, div.CodeSeg
	{mso-style-name:CodeSeg;
	mso-style-update:auto;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:widow-orphan;
	tab-stops:18.0pt 22.5pt 54.0pt 90.0pt 126.0pt 162.0pt 198.0pt 234.0pt 270.0pt 306.0pt 342.0pt;
	background:#F2F2F2;
	mso-shading:windowtext;
	mso-pattern:gray-5 auto;
	text-autospace:none;
	border:none;
	mso-border-alt:solid #999999 3.0pt;
	padding:0cm;
	mso-padding-alt:1.0pt 1.0pt 15.0pt 1.0pt;
	mso-border-shadow:yes;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:宋体;
	mso-fareast-language:RU;
	font-weight:bold;}
p.NewSectionPara, li.NewSectionPara, div.NewSectionPara
	{mso-style-name:NewSectionPara;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:widow-orphan;
	tab-stops:22.5pt;
	text-autospace:none;
	font-size:10.0pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-fareast-language:RU;}
p.Descript, li.Descript, div.Descript
	{mso-style-name:Descript;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:widow-orphan;
	tab-stops:22.5pt 27.0pt;
	text-autospace:none;
	font-size:10.0pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-fareast-language:RU;}
p.Code, li.Code, div.Code
	{mso-style-name:Code;
	mso-style-parent:CodeSeg;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:widow-orphan;
	tab-stops:18.0pt 22.5pt 54.0pt 90.0pt 126.0pt 162.0pt 198.0pt 234.0pt 270.0pt 306.0pt 342.0pt;
	text-autospace:none;
	font-size:7.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:宋体;
	mso-fareast-language:RU;
	font-weight:bold;}
 /* Page Definitions */
@page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
@page Section2
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:42.55pt;
	mso-footer-margin:49.6pt;
	mso-paper-source:0;
	layout-grid:15.6pt;}
div.Section2
	{page:Section2;}
-->
</style>
</head>

<body background="./系统的服务例程.files/image001.jpg" lang=ZH-CN style='tab-interval:21.0pt;text-justify-trim:punctuation'>

<div class=Section1><b><span lang=EN-US style='font-size:14.0pt;mso-bidi-font-size:
9.0pt;font-family:"Times New Roman";mso-fareast-font-family:宋体;mso-font-kerning:
22.0pt;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:
AR-SA'><br clear=all style='page-break-before:always'>
</span></b>

<h1><span lang=EN-US style='font-size:14.0pt;mso-bidi-font-size:9.0pt'>INT8U
OSTaskDelReq(INT8U prio);<o:p></o:p></span></h1>

<p class=Descript><b><span lang=EN-US style='font-family:"Courier New"'>OSTaskDelReq()</span></b><span
lang=EN-US> allows your application to request that a task deletes itself.<span
style="mso-spacerun: yes">&nbsp; </span>Basically, you would use </span><b><span
lang=EN-US style='font-family:"Courier New"'>OSTaskDelReq()</span></b><span
lang=EN-US> when you need to delete a task that can potentially own resources
(e.g. the task may own a semaphore).<span style="mso-spacerun: yes">&nbsp;
</span>In this case, you don’t want to delete the task until the resource is
released.<span style="mso-spacerun: yes">&nbsp; </span>The requesting task
calls </span><b><span lang=EN-US style='font-family:"Courier New"'>OSTaskDelReq()</span></b><span
lang=EN-US> to indicate that the task needs to be deleted.<span
style="mso-spacerun: yes">&nbsp; </span>Deletion of the task is, however,
deferred to the task being deleted.<span style="mso-spacerun: yes">&nbsp;
</span>In other words, the task is actually deleted when it regains control of
the CPU.<span style="mso-spacerun: yes">&nbsp; </span>For example, suppose task
#10 needs to be deleted.<span style="mso-spacerun: yes">&nbsp; </span>The task
desiring to delete this task (example task #5) would call </span><b><span
lang=EN-US style='font-family:"Courier New"'>OSTaskDelReq(10)</span></b><span
lang=EN-US>.<span style="mso-spacerun: yes">&nbsp; </span>When task #10 gets to
execute it would call </span><b><span lang=EN-US style='font-family:"Courier New"'>OSTaskDelReq(OS_PRIO_SELF)</span></b><span
lang=EN-US> and monitors the returned value.<span style="mso-spacerun:
yes">&nbsp; </span>If the return value is </span><b><span lang=EN-US
style='font-family:"Courier New"'>OS_TASK_DEL_REQ</span></b><span lang=EN-US>
then task #10 is asked to delete itself.<span style="mso-spacerun: yes">&nbsp;
</span>At this point, task #10 would call </span><b><span lang=EN-US
style='font-family:"Courier New"'>OSTaskDel(OS_PRIO_SELF)</span></b><span
lang=EN-US>.<span style="mso-spacerun: yes">&nbsp; </span>Task #5 would know
whether task #10 has been deleted by calling </span><b><span lang=EN-US
style='font-family:"Courier New"'>OSTaskDelReq(10)</span></b><span lang=EN-US>
and check the return code.<span style="mso-spacerun: yes">&nbsp; </span>If the
return code is </span><b><span lang=EN-US style='font-family:"Courier New"'>OS_TASK_NOT_EXIST</span></b><span
lang=EN-US> then task #5 would know that task #10 has been deleted.<span
style="mso-spacerun: yes">&nbsp; </span>In this case, task #5 may have to check
periodically, though.</span></p>

<p class=NewSectionPara><span lang=EN-US><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=NewSectionPara><b><span lang=EN-US>Arguments<o:p></o:p></span></b></p>

<p class=Descript><b><span lang=EN-US style='font-family:"Courier New"'>prio</span></b><span
lang=EN-US> is the task's priority number of the task to delete.<span
style="mso-spacerun: yes">&nbsp; </span>If you specify </span><b><span
lang=EN-US style='font-family:"Courier New"'>OS_PRIO_SELF</span></b><span
lang=EN-US>, then you are asking whether another task wants you to be deleted.</span></p>

<p class=NewSectionPara><span lang=EN-US><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=NewSectionPara><b><span lang=EN-US>Returned Value<o:p></o:p></span></b></p>

<p class=Descript><b><span lang=EN-US style='font-family:"Courier New"'>OSTaskDelReq()</span></b><span
lang=EN-US> returns one of the following error codes:</span></p>

<p class=Descript style='margin-left:45.0pt;text-indent:-18.0pt'><span
lang=EN-US>1)<span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
lang=EN-US style='font-family:"Courier New"'>OS_NO_ERR</span></b><span
lang=EN-US>, if the task deletion has been registered</span></p>

<p class=Descript style='margin-left:45.0pt;text-indent:-18.0pt'><span
lang=EN-US>2)<span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span></span><b><span
lang=EN-US style='font-family:"Courier New"'>OS_TASK_NOT_EXIST</span></b><span
lang=EN-US>, if the task does not exist.<span style="mso-spacerun: yes">&nbsp;
</span>The requesting task can monitor this return code to see if the task

⌨️ 快捷键说明

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