blob: c9aa65548e44b4afd78826c49f366afb05aa0dcf [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>OsclSemaphore class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
<hr><h1>OsclSemaphore Class Reference</h1><code>#include &lt;<a class="el" href="oscl__semaphore_8h-source.html">oscl_semaphore.h</a>&gt;</code>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF&nbsp;</td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a0">OsclSemaphore</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF&nbsp;</td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a1">~OsclSemaphore</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a>&nbsp;</td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a2">Create</a> (uint32 initVal=0)</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a>&nbsp;</td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a3">Close</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a>&nbsp;</td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a4">Wait</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a>&nbsp;</td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a5">Wait</a> (uint32 timeout_msec)</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a>&nbsp;</td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a6">TryWait</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a>&nbsp;</td><td valign=bottom><a class="el" href="classOsclSemaphore.html#a7">Signal</a> ()</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Class Semaphore
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="OsclSemaphore::OsclSemaphore"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF OsclSemaphore::OsclSemaphore </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Class constructor </td>
</tr>
</table>
<a name="a1" doxytag="OsclSemaphore::~OsclSemaphore"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF OsclSemaphore::~OsclSemaphore </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Class destructor </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a3" doxytag="OsclSemaphore::Close"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Close </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Closes the Semaphore<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>It</em>&nbsp;</td><td>
wont take any parameters</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
Returns the Error whether it is success or failure incase of failure it will return what is the specific error </dl> </td>
</tr>
</table>
<a name="a2" doxytag="OsclSemaphore::Create"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Create </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">uint32&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>initVal</em> = 0 </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Creates the Semaphore<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>Intialcount</em>&nbsp;</td><td>
</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
Returns the Error whether it is success or failure incase of failure it will return what is the specific error </dl> </td>
</tr>
</table>
<a name="a7" doxytag="OsclSemaphore::Signal"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Signal </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Signals that the thread is finished with the Semaphore<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>It</em>&nbsp;</td><td>
wont take any parameters</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
Returns the Error whether it is success or failure incase of failure it will return what is the specific error </dl> </td>
</tr>
</table>
<a name="a6" doxytag="OsclSemaphore::TryWait"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::TryWait </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
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>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>It</em>&nbsp;</td><td>
wont take any parameters</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
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>
</tr>
</table>
<a name="a5" doxytag="OsclSemaphore::Wait"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Wait </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">uint32&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>timeout_msec</em> </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Makes the thread to wait on the Semaphore, with a timeout.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>timeout</em>&nbsp;</td><td>
in milliseconds.</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
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>
</tr>
</table>
<a name="a4" doxytag="OsclSemaphore::Wait"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> OsclSemaphore::Wait </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Makes the thread to wait on the Semaphore<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>It</em>&nbsp;</td><td>
wont take any parameters</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
Returns the Error whether it is success or failure incase of failure it will return what is the specific error </dl> </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="oscl__semaphore_8h-source.html">oscl_semaphore.h</a></ul>
<hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
</small></address>
</body>
</html>