📄 libs107.htm
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Quadralay WebWorks Publisher Professional Edition 6.0.5">
<meta name="TEMPLATEBASE" content="book_html">
<meta name="LASTUPDATED" content="12/01/03 14:15:58">
<title>semaphore_wait</title>
<STYLE TYPE="text/css">
<!--
span.Signal { text-transform: uppercase; font-family: Verdana }
-->
</STYLE>
</head>
<body link="#3366CC" vlink="#9999CC" text="#000000" alink="#0000CC" bgcolor="#FFFFFF"
background="images/backgrnd.gif">
<p><img src="images/stlogo.gif" width="106" height="83" align="left"
alt="logo here!"> </p>
<table width="331" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><a href="os20toc.htm"><img src="images/navtoc.gif" width="84" height="23"
border="0" alt="TOC"> </a></td>
<td><a href="libs106.htm"><img src="images/navprev.gif" width="80" height="23"
border="0" alt="PREV"> </a></td>
<td><a href="libs108.htm"><img src="images/navnext.gif" width="83" height="23"
border="0" alt="NEXT"> </a></td>
<td><a href="os20ix.htm"><img src="images/navidx.gif" width="84" height="23"
border="0" alt="INDEX"> </a></td>
</tr>
</table>
<p><br clear="all">
</p>
<hr align="left">
<blockquote>
<h2>
<a name="1208594"> </a><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">semaphore_wait</font>
</h2><hr>
<p>
<a name="1208595"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">Wait for a semaphore</font>
</p>
<h3>
<a name="1208596"> </a><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">Synopsis</font>
</h3>
<a name="1208597"> </a><font size=2 face=Courier><strong>#include <semaphor.h><br></strong></font>
<a name="1208598"> </a><font size=2 face=Courier><strong>int semaphore_wait( semaphore_t* <font size=2 face=Courier><strong><em>Sem</em></strong></font> );<br></strong></font>
<h3>
<a name="1208599"> </a><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">Arguments</font>
</h3>
<p>
<a name="1233492"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif"><b><font size=2 face=Courier><strong>semaphore_t* </strong></font><font size=2 face=Courier><strong><em>Sem</em></strong></font></b></font>
<br>
<dl><dl> <dl>
<dt> <a name="1233494"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">Pointer to a semaphore</font>
</dl>
</dl></dl>
<h3>
<a name="1208602"> </a><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">Results</font>
</h3>
<p>
<a name="1208603"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">Always returns <font size=2 face=Courier><strong>0</strong></font>.</font>
</p>
<h3>
<a name="1208604"> </a><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">Errors</font>
</h3>
<p>
<a name="1208605"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">None</font>
</p>
<h3>
<a name="1208606"> </a><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">Description</font>
</h3>
<p>
<a name="1208607"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">Perform a wait operation on the specified semaphore. The exact behavior of this function depends on the semaphore type. The operation checks the semaphore counter, and if it is <font size=2 face=Courier><strong>0</strong></font>, adds the current task to the list of queued tasks before descheduling. Otherwise the semaphore counter is decremented, and the task continues running.</font>
</p>
<h3>
<a name="1208608"> </a><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">Callable from</font>
</h3>
<p>
<a name="1208609"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif"><strong>For non-timeout FIFO</strong>, this function is callable from a task or a high priority process (on an ST20C2).</font>
</p>
<p>
<a name="1208611"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif"><strong>For timeout FIFO</strong>, timeout priority and non-timeout priority, this function is callable from tasks only.</font>
</p>
<h3>
<a name="1208617"> </a><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">See also</font>
</h3>
<p>
<a name="1208618"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif"><a href="libs106.htm#1208574"><font color="#0000ff" face="Verdana, Arial, Helvetica, sans-serif"><i>semaphore_signal</i></font></a>, <a href="libs108.htm#1208621"><font color="#0000ff" face="Verdana, Arial, Helvetica, sans-serif"><i>semaphore_wait_timeout</i></font></a></font>
</p>
</blockquote>
<hr>
<table width="331" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td><a href="os20toc.htm"><img src="images/navtoc.gif" width="84" height="23"
border="0" alt="TOC"> </a></td>
<td><a href="libs106.htm"><img src="images/navprev.gif" width="80" height="23"
border="0" alt="PREV"> </a></td>
<td><a href="libs108.htm"><img src="images/navnext.gif" width="83" height="23"
border="0" alt="NEXT"> </a></td>
<td><a href="os20ix.htm"><img src="images/navidx.gif" width="84" height="23"
border="0" alt="INDEX"> </a></td>
</tr>
</table>
<font size=1 face="Verdana, Arial, Helvetica, sans-serif"> © 2001, 2002, 2003 STMicroelectronics. All Rights Reserved.<br>
ADCS 7473749B</font>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -