1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
<HTML><HEAD>
<TITLE>Tcl API Reference -- ns_sema</TITLE>
<LINK rel=Previous href="tapi-116.htm">
<LINK rel=ToC href="toc.htm">
<LINK rel=Index href="master.htm">
<LINK rel=Next href="tapi-118.htm">
</HEAD><BODY BGCOLOR="#ffffff"><A NAME="topofpage"></A>
<TABLE WIDTH=100%>
<TR>
<TD ALIGN=LEFT>
<A NAME="topofpage"></A> <IMG SRC="as-c-sm.gif">
</TD>
<TD ALIGN=RIGHT>
<A href="tapi-116.htm"><IMG BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
<A href=toc.htm> <IMG BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
<A href=master.htm> <IMG BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
<A href="tapi-118.htm"> <IMG BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
<A name="7983"> </A>
</TD>
</TR>
</TABLE>
<a name="81850">
</a><h3>ns_sema</h3>
<a name="81851">
</a><h4>Overview</h4>
<p><a name="81852">
</a>Manage semaphores</p>
<a name="81853">
</a><h4>Syntax</h4>
<p><a name="81854">
</a><b>ns_sema create</b> ?<i>count</i>?</p>
<p><a name="133166">
</a><b>ns_sema destroy</b> <i>semaid</i></p>
<p><a name="81855">
</a><b>ns_sema release</b> <i>semaid</i> ?<i>count</i>?</p>
<p><a name="81856">
</a><b>ns_sema wait</b> <i>semaid</i></p>
<a name="81858">
</a><h4>Description</h4>
<p><a name="81859">
</a><b>ns_sema create</b> initializes a semaphore and returns an ID for it. If the <i>count</i> argument is specified, the semaphore is initialized with that count. The default for <i>count</i> is 0.</p>
<p><a name="133170">
</a><b>ns_sema destroy</b> frees the resources associated with the specified semaphore. The <i>semaid</i> argument is the ID returned by <b>ns_sema create</b> when the semaphore was created.</p>
<p><a name="81860">
</a><b>ns_sema release</b> increments the count of the specified semaphore. By default, the semaphore is incremented 1 (one) time. If the <i>count</i> argument is specified, the semaphore is incremented <i>count</i> times. The <i>semaid</i> argument is the ID returned by <b>ns_sema create</b> when the semaphore was created.</p>
<p><a name="81861">
</a><b>ns_sema wait</b> waits for the count of the specified semaphore to be greater than 0 (zero). If it is greater than 0, the count is decremented and processing continues. If it is not greater than 0, it is blocked until this is possible. The <i>semaid</i> argument is the ID returned by <b>ns_sema create</b> when the semaphore was created.</p>
<a name="86824">
</a><h4>See Also</h4>
<p><a name="86834">
</a>Ns_InitializeSemaphore</p>
<p><a name="86826">
</a>Ns_DestroySemaphore</p>
<p><a name="86828">
</a>Ns_ReleaseSemaphore</p>
<p><a name="86829">
</a>Ns_WaitForSemaphore</p>
<TABLE BORDER="2" CELLPADDING="1" width="100%">
<TR><TD COLSPAN=3><P ALIGN=Center>
<IMG SRC="bluebult.gif">
<A HREF="#topofpage">
<FONT SIZE=-1>Top of Page</FONT></A>
<IMG SRC="bluebult.gif">
</TD></TR>
<TR><TD COLSPAN=3><P ALIGN=Center>
<A href="tapi-116.htm">
<IMG BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
<A href=toc.htm>
<IMG BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
<A href=master.htm>
<IMG BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
<A href="tapi-118.htm">
<IMG BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
<BR align=center>
<FONT size=-1>Copyright © 1998-99 America Online,
Inc.</FONT>
</TD></TR></TABLE></BODY></HTML>
|