1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" /> 7 <style type="text/css"><!-- 8 span.static_style 9 { 10 font-size : 8pt; 11 color : white; 12 font-weight : bold; 13 background : #44f; 14 border-left : solid 1px #aaf; 15 border-top : solid 1px #aaf; 16 border-right : solid 1px #00c; 17 border-bottom : solid 1px #00c; 18 padding-left : 2px; 19 padding-right : 2px; 20 } 21 22 span.virtual_style 23 { 24 font-size : 8pt; 25 color : white; 26 font-weight : bold; 27 background : #0a0; 28 border-left : solid 1px #0f0; 29 border-top : solid 1px #0f0; 30 border-right : solid 1px #060; 31 border-bottom : solid 1px #060; 32 padding-left : 2px; 33 padding-right : 2px; 34 } 35 36 span.protected_style 37 { 38 font-size : 8pt; 39 color : white; 40 font-weight : bold; 41 background : #444; 42 border-left : solid 1px #ccc; 43 border-top : solid 1px #ccc; 44 border-right : solid 1px #222; 45 border-bottom : solid 1px #222; 46 padding-left : 2px; 47 padding-right : 2px; 48 } 49 --></style> 50<title>nn::os::LightSemaphore</title> 51 </head> 52 <body> 53<h1><CODE>nn::os::LightSemaphore</CODE> Class</h1> 54 <div class="section"> 55<b>Header file: </b>nn/os.h</div> 56<h2>Syntax</h2> 57 <div class="section"> 58 <pre class="definition">class LightSemaphore</pre> 59 </div> 60<h2>Description</h2> 61 <div class="section"> 62<p>Synchronization mechanism for mutual exclusion of the number of resources between threads.</p><p>This function has an internal counter that is incremented and decremented in order to manage the number of resources. If the counter value is <CODE>0</CODE>, it is possible to wait until it becomes <CODE>1</CODE> or greater.</p><p>The <a href="../../../nn/os/LightSemaphore/Overview.html"><CODE>nn::os::LightSemaphore</CODE></a> class is superior to the <a href="../../../nn/os/Semaphore/Overview.html"><CODE>nn::os::Semaphore</CODE></a> class and should therefore be used in normal cases. Its only disadvantage is the fact that it is unable to wait for multiple synchronization objects simultaneously.</p><p>All member functions of this class are thread-safe except for the <CODE>Initialize</CODE> and <CODE>Finalize</CODE> functions.</p><!-- write here --></div> 63 <a name="function" id="function"> 64<h2>Member Functions</h2> 65 <div class="section"> 66 <table class="members"> 67 <tr> 68<th class="category" colspan="3">Initialization/Finalization</th> 69 </tr> 70 <tr> 71 <td width="100"> </td> 72 <th> 73<a href="../../../nn/os/LightSemaphore/LightSemaphore.html"><CODE>LightSemaphore</CODE></a> 74 </th> 75<td>Constructor.</td> 76 </tr> 77 <tr> 78 <td width="100"> </td> 79 <th> 80<a href="../../../nn/os/LightSemaphore/Initialize.html"><CODE>Initialize</CODE></a> 81 </th> 82<td>Performs initialization.</td> 83 </tr> 84 <tr> 85 <td width="100"> </td> 86 <th> 87<a href="../../../nn/os/LightSemaphore/Finalize.html"><CODE>Finalize</CODE></a> 88 </th> 89<td>Performs finalization.</td> 90 </tr> 91 <tr> 92<th class="category" colspan="3">Obtaining Debug Info</th> 93 </tr> 94 <tr> 95 <td width="100"> </td> 96 <th> 97<a href="../../../nn/os/LightSemaphore/GetCount.html"><CODE>GetCount</CODE></a> 98 </th> 99<td>Gets the maximum counter value that was specified by either the constructor or <a href="../../../nn/os/LightSemaphore/Initialize.html"><CODE>Initialize</CODE></a>.</td> 100 </tr> 101 <tr> 102<th class="category" colspan="3">Counter Operations and Blocking</th> 103 </tr> 104 <tr> 105 <td width="100"> </td> 106 <th> 107<a href="../../../nn/os/LightSemaphore/Acquire.html"><CODE>Acquire</CODE></a> 108 </th> 109<td>Decrements the counter value by one.</td> 110 </tr> 111 <tr> 112 <td width="100"> </td> 113 <th> 114<a href="../../../nn/os/LightSemaphore/TryAcquire.html"><CODE>TryAcquire</CODE></a> 115 </th> 116<td>Tries to decrement the counter value by one.</td> 117 </tr> 118 <tr> 119 <td width="100"> </td> 120 <th> 121<a href="../../../nn/os/LightSemaphore/Release.html"><CODE>Release</CODE></a> 122 </th> 123<td>Adds to the counter value.</td> 124 </tr> </table> 125 </div> 126 </a> 127<h2>Revision History</h2> 128 <div class="section"> 129 <dl class="history"> 130 <dt>2010/06/14</dt> 131<dd>Initial version.<br /> 132 </dd> 133 </dl> 134 </div> 135 <hr><p>CONFIDENTIAL</p></body> 136</html>