1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> 3 <title>OsclSemaphore class Reference</title> 4 <link href="doxygen.css" rel="stylesheet" type="text/css"> 5 </head><body> 6 <!-- Generated by Doxygen 1.2.18 --> 7 <center> 8 <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center> 9 <hr><h1>OsclSemaphore Class Reference</h1><code>#include <<a class="el" href="oscl__semaphore_8h-source.html">oscl_semaphore.h</a>></code> 10 <p> 11 <table border=0 cellpadding=0 cellspacing=0> 12 <tr><td></td></tr> 13 <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> 14 <tr><td nowrap align=right valign=top>OSCL_IMPORT_REF </td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a0">OsclSemaphore</a> ()</td></tr> 15 <tr><td nowrap align=right valign=top>OSCL_IMPORT_REF </td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a1">~OsclSemaphore</a> ()</td></tr> 16 <tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> </td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a2">Create</a> (uint32 initVal=0)</td></tr> 17 <tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> </td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a3">Close</a> ()</td></tr> 18 <tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> </td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a4">Wait</a> ()</td></tr> 19 <tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> </td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a5">Wait</a> (uint32 timeout_msec)</td></tr> 20 <tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> </td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a6">TryWait</a> ()</td></tr> 21 <tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> </td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a7">Signal</a> ()</td></tr> 22 </table> 23 <hr><a name="_details"></a><h2>Detailed Description</h2> 24 Class Semaphore 25 <p> 26 <hr><h2>Constructor & Destructor Documentation</h2> 27 <a name="a0" doxytag="OsclSemaphore::OsclSemaphore"></a><p> 28 <table width="100%" cellpadding="2" cellspacing="0" border="0"> 29 <tr> 30 <td class="md"> 31 <table cellpadding="0" cellspacing="0" border="0"> 32 <tr> 33 <td class="md" nowrap valign="top"> OSCL_IMPORT_REF OsclSemaphore::OsclSemaphore </td> 34 <td class="md" valign="top">( </td> 35 <td class="mdname1" valign="top" nowrap> </td> 36 <td class="md" valign="top">) </td> 37 <td class="md" nowrap></td> 38 </tr> 39 40 </table> 41 </td> 42 </tr> 43 </table> 44 <table cellspacing=5 cellpadding=0 border=0> 45 <tr> 46 <td> 47 48 </td> 49 <td> 50 51 <p> 52 Class constructor </td> 53 </tr> 54 </table> 55 <a name="a1" doxytag="OsclSemaphore::~OsclSemaphore"></a><p> 56 <table width="100%" cellpadding="2" cellspacing="0" border="0"> 57 <tr> 58 <td class="md"> 59 <table cellpadding="0" cellspacing="0" border="0"> 60 <tr> 61 <td class="md" nowrap valign="top"> OSCL_IMPORT_REF OsclSemaphore::~OsclSemaphore </td> 62 <td class="md" valign="top">( </td> 63 <td class="mdname1" valign="top" nowrap> </td> 64 <td class="md" valign="top">) </td> 65 <td class="md" nowrap></td> 66 </tr> 67 68 </table> 69 </td> 70 </tr> 71 </table> 72 <table cellspacing=5 cellpadding=0 border=0> 73 <tr> 74 <td> 75 76 </td> 77 <td> 78 79 <p> 80 Class destructor </td> 81 </tr> 82 </table> 83 <hr><h2>Member Function Documentation</h2> 84 <a name="a3" doxytag="OsclSemaphore::Close"></a><p> 85 <table width="100%" cellpadding="2" cellspacing="0" border="0"> 86 <tr> 87 <td class="md"> 88 <table cellpadding="0" cellspacing="0" border="0"> 89 <tr> 90 <td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Close </td> 91 <td class="md" valign="top">( </td> 92 <td class="mdname1" valign="top" nowrap> </td> 93 <td class="md" valign="top">) </td> 94 <td class="md" nowrap></td> 95 </tr> 96 97 </table> 98 </td> 99 </tr> 100 </table> 101 <table cellspacing=5 cellpadding=0 border=0> 102 <tr> 103 <td> 104 105 </td> 106 <td> 107 108 <p> 109 Closes the Semaphore<dl compact><dt><b>Parameters: </b></dt><dd> 110 <table border=0 cellspacing=2 cellpadding=0> 111 <tr><td valign=top><em>It</em> </td><td> 112 wont take any parameters</td></tr> 113 </table> 114 </dl><dl compact><dt><b>Returns: </b></dt><dd> 115 Returns the Error whether it is success or failure incase of failure it will return what is the specific error </dl> </td> 116 </tr> 117 </table> 118 <a name="a2" doxytag="OsclSemaphore::Create"></a><p> 119 <table width="100%" cellpadding="2" cellspacing="0" border="0"> 120 <tr> 121 <td class="md"> 122 <table cellpadding="0" cellspacing="0" border="0"> 123 <tr> 124 <td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Create </td> 125 <td class="md" valign="top">( </td> 126 <td class="md" nowrap valign="top">uint32 </td> 127 <td class="mdname1" valign="top" nowrap> <em>initVal</em> = 0 </td> 128 <td class="md" valign="top">) </td> 129 <td class="md" nowrap></td> 130 </tr> 131 132 </table> 133 </td> 134 </tr> 135 </table> 136 <table cellspacing=5 cellpadding=0 border=0> 137 <tr> 138 <td> 139 140 </td> 141 <td> 142 143 <p> 144 Creates the Semaphore<dl compact><dt><b>Parameters: </b></dt><dd> 145 <table border=0 cellspacing=2 cellpadding=0> 146 <tr><td valign=top><em>Intialcount</em> </td><td> 147 </td></tr> 148 </table> 149 </dl><dl compact><dt><b>Returns: </b></dt><dd> 150 Returns the Error whether it is success or failure incase of failure it will return what is the specific error </dl> </td> 151 </tr> 152 </table> 153 <a name="a7" doxytag="OsclSemaphore::Signal"></a><p> 154 <table width="100%" cellpadding="2" cellspacing="0" border="0"> 155 <tr> 156 <td class="md"> 157 <table cellpadding="0" cellspacing="0" border="0"> 158 <tr> 159 <td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Signal </td> 160 <td class="md" valign="top">( </td> 161 <td class="mdname1" valign="top" nowrap> </td> 162 <td class="md" valign="top">) </td> 163 <td class="md" nowrap></td> 164 </tr> 165 166 </table> 167 </td> 168 </tr> 169 </table> 170 <table cellspacing=5 cellpadding=0 border=0> 171 <tr> 172 <td> 173 174 </td> 175 <td> 176 177 <p> 178 Signals that the thread is finished with the Semaphore<dl compact><dt><b>Parameters: </b></dt><dd> 179 <table border=0 cellspacing=2 cellpadding=0> 180 <tr><td valign=top><em>It</em> </td><td> 181 wont take any parameters</td></tr> 182 </table> 183 </dl><dl compact><dt><b>Returns: </b></dt><dd> 184 Returns the Error whether it is success or failure incase of failure it will return what is the specific error </dl> </td> 185 </tr> 186 </table> 187 <a name="a6" doxytag="OsclSemaphore::TryWait"></a><p> 188 <table width="100%" cellpadding="2" cellspacing="0" border="0"> 189 <tr> 190 <td class="md"> 191 <table cellpadding="0" cellspacing="0" border="0"> 192 <tr> 193 <td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::TryWait </td> 194 <td class="md" valign="top">( </td> 195 <td class="mdname1" valign="top" nowrap> </td> 196 <td class="md" valign="top">) </td> 197 <td class="md" nowrap></td> 198 </tr> 199 200 </table> 201 </td> 202 </tr> 203 </table> 204 <table cellspacing=5 cellpadding=0 border=0> 205 <tr> 206 <td> 207 208 </td> 209 <td> 210 211 <p> 212 Try to acquire semaphore ,if the semaphore is already acquired by another thread, calling thread immediately returns with out blocking<dl compact><dt><b>Parameters: </b></dt><dd> 213 <table border=0 cellspacing=2 cellpadding=0> 214 <tr><td valign=top><em>It</em> </td><td> 215 wont take any parameters</td></tr> 216 </table> 217 </dl><dl compact><dt><b>Returns: </b></dt><dd> 218 Returns SUCCESS_ERROR if the semaphore was acquired, SEM_LOCKED_ERROR if the semaphore cannot be acquired without waiting, or an error code if the operation failed. Note: this function may not be supported on all platforms, and may return NOT_IMPLEMENTED. </dl> </td> 219 </tr> 220 </table> 221 <a name="a5" doxytag="OsclSemaphore::Wait"></a><p> 222 <table width="100%" cellpadding="2" cellspacing="0" border="0"> 223 <tr> 224 <td class="md"> 225 <table cellpadding="0" cellspacing="0" border="0"> 226 <tr> 227 <td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Wait </td> 228 <td class="md" valign="top">( </td> 229 <td class="md" nowrap valign="top">uint32 </td> 230 <td class="mdname1" valign="top" nowrap> <em>timeout_msec</em> </td> 231 <td class="md" valign="top">) </td> 232 <td class="md" nowrap></td> 233 </tr> 234 235 </table> 236 </td> 237 </tr> 238 </table> 239 <table cellspacing=5 cellpadding=0 border=0> 240 <tr> 241 <td> 242 243 </td> 244 <td> 245 246 <p> 247 Makes the thread to wait on the Semaphore, with a timeout.<dl compact><dt><b>Parameters: </b></dt><dd> 248 <table border=0 cellspacing=2 cellpadding=0> 249 <tr><td valign=top><em>timeout</em> </td><td> 250 in milliseconds.</td></tr> 251 </table> 252 </dl><dl compact><dt><b>Returns: </b></dt><dd> 253 Returns SUCCESS_ERROR if the semaphore was aquired, WAIT_TIMEOUT_ERROR if the timeout expired without acquiring the semaphore, or an error code if the operation failed. Note: this function may not be supported on all platforms, and may return NOT_IMPLEMENTED. </dl> </td> 254 </tr> 255 </table> 256 <a name="a4" doxytag="OsclSemaphore::Wait"></a><p> 257 <table width="100%" cellpadding="2" cellspacing="0" border="0"> 258 <tr> 259 <td class="md"> 260 <table cellpadding="0" cellspacing="0" border="0"> 261 <tr> 262 <td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Wait </td> 263 <td class="md" valign="top">( </td> 264 <td class="mdname1" valign="top" nowrap> </td> 265 <td class="md" valign="top">) </td> 266 <td class="md" nowrap></td> 267 </tr> 268 269 </table> 270 </td> 271 </tr> 272 </table> 273 <table cellspacing=5 cellpadding=0 border=0> 274 <tr> 275 <td> 276 277 </td> 278 <td> 279 280 <p> 281 Makes the thread to wait on the Semaphore<dl compact><dt><b>Parameters: </b></dt><dd> 282 <table border=0 cellspacing=2 cellpadding=0> 283 <tr><td valign=top><em>It</em> </td><td> 284 wont take any parameters</td></tr> 285 </table> 286 </dl><dl compact><dt><b>Returns: </b></dt><dd> 287 Returns the Error whether it is success or failure incase of failure it will return what is the specific error </dl> </td> 288 </tr> 289 </table> 290 <hr>The documentation for this class was generated from the following file:<ul> 291 <li><a class="el" href="oscl__semaphore_8h-source.html">oscl_semaphore.h</a></ul> 292 <hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> 293 <address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> 294 </small></address> 295 </body> 296 </html> 297