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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
<HTML>
<HEAD>
<TITLE>class Lockable</TITLE>
<META NAME="Generator" CONTENT="KDOC ">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD>
<TABLE BORDER="0">
<TR><TD valign="top" align="left" cellspacing="10">
<h1>class Lockable</h1>
</TD>
<TD valign="top" align="right" colspan="1">Abstract interface for lockable objects. <small><A HREF="#longdesc">More...</A></small></TD></TR>
</TABLE>
<HR>
<TABLE BORDER="0">
<TR><TH colspan="2">Contains pure virtuals</TH></TR><TR><TH>Full name</TH><TD><code><A HREF="TelEngine.html">TelEngine</A>::Lockable</code></TD></TR>
<TR><TH>Definition</TH><TD><code>#include <<A HREF="yateclass_h.html">yateclass.h</A>></code></TD></TR>
<TR><TH>Inherited by</TH><TD><A HREF="TelEngine__AnalogLine.html">AnalogLine</A>, <A HREF="TelEngine__AnalogLineGroup.html">AnalogLineGroup</A>, <i><A HREF="TelEngine__ChanAssistList.html">ChanAssistList</A></i>, <A HREF="TelEngine__ClientAccount.html">ClientAccount</A>, <A HREF="TelEngine__ClientAccountList.html">ClientAccountList</A>, <i><A HREF="TelEngine__ClientDriver.html">ClientDriver</A></i>, <A HREF="TelEngine__DataSource.html">DataSource</A>, <i><A HREF="TelEngine__Driver.html">Driver</A></i>, <A HREF="TelEngine__IAXEngine.html">IAXEngine</A>, <A HREF="TelEngine__IAXMetaTrunkFrame.html">IAXMetaTrunkFrame</A>, <A HREF="TelEngine__IAXTransaction.html">IAXTransaction</A>, <A HREF="TelEngine__ISDNQ931.html">ISDNQ931</A>, <A HREF="TelEngine__ISDNQ931Call.html">ISDNQ931Call</A>, <A HREF="TelEngine__ISDNQ931CallMonitor.html">ISDNQ931CallMonitor</A>, <A HREF="TelEngine__ISDNQ931Monitor.html">ISDNQ931Monitor</A>, <A HREF="TelEngine__JBEngine.html">JBEngine</A>, <A HREF="TelEngine__JBMessage.html">JBMessage</A>, <A HREF="TelEngine__JBPresence.html">JBPresence</A>, <A HREF="TelEngine__JBService.html">JBService</A>, <A HREF="TelEngine__JGEngine.html">JGEngine</A>, <i><A HREF="TelEngine__JGSession.html">JGSession</A></i>, <A HREF="TelEngine__JGSession0.html">JGSession0</A>, <A HREF="TelEngine__JGSession1.html">JGSession1</A>, <A HREF="TelEngine__JIDResourceList.html">JIDResourceList</A>, <A HREF="TelEngine__MGCPEndpoint.html">MGCPEndpoint</A>, <A HREF="TelEngine__MGCPEngine.html">MGCPEngine</A>, <A HREF="TelEngine__MGCPTransaction.html">MGCPTransaction</A>, <A HREF="TelEngine__MessageDispatcher.html">MessageDispatcher</A>, <A HREF="TelEngine__Module.html">Module</A>, <i><A HREF="TelEngine__MultiRouter.html">MultiRouter</A></i>, <A HREF="TelEngine__Mutex.html">Mutex</A>, <A HREF="TelEngine__RTPGroup.html">RTPGroup</A>, <A HREF="TelEngine__SDPParser.html">SDPParser</A>, <i><A HREF="TelEngine__SIPEngine.html">SIPEngine</A></i>, <A HREF="TelEngine__SS7BICC.html">SS7BICC</A>, <A HREF="TelEngine__SS7ISUP.html">SS7ISUP</A>, <A HREF="TelEngine__SS7ISUPCall.html">SS7ISUPCall</A>, <A HREF="TelEngine__SS7MTP2.html">SS7MTP2</A>, <A HREF="TelEngine__SS7MTP3.html">SS7MTP3</A>, <A HREF="TelEngine__SS7Route.html">SS7Route</A>, <A HREF="TelEngine__SS7Router.html">SS7Router</A>, <A HREF="TelEngine__SS7TUP.html">SS7TUP</A>, <A HREF="TelEngine__Semaphore.html">Semaphore</A>, <i><A HREF="TelEngine__SignallingCall.html">SignallingCall</A></i>, <A HREF="TelEngine__SignallingCallControl.html">SignallingCallControl</A>, <A HREF="TelEngine__SignallingCircuitGroup.html">SignallingCircuitGroup</A>, <A HREF="TelEngine__SignallingEngine.html">SignallingEngine</A>, <i><A HREF="TelEngine__ThreadedSource.html">ThreadedSource</A></i>, <A HREF="TelEngine__XMLParser.html">XMLParser</A>, <A HREF="TelEngine__XMPPUser.html">XMPPUser</A>, <A HREF="TelEngine__XMPPUserRoster.html">XMPPUserRoster</A></TD></TR>
<TR><TH><A HREF="full-list-TelEngine__Lockable.html">List of all Methods</A></TH></TR>
</TABLE>
</TD>
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
</TABLE></TD></TR></TABLE>
<h4>Public Methods</h4><ul><LI>virtual <b><A HREF="#ref1">~Lockable</A></b> ()
</LI>
<LI>virtual bool <b><i><A HREF="#ref2">lock</A></i></b> (long maxwait = -1)
</LI>
<LI>virtual bool <b><i><A HREF="#ref3">unlock</A></i></b> ()
</LI>
<LI>virtual bool <b><i><A HREF="#ref4">locked</A></i></b> () const
</LI>
<LI>virtual bool <b><A HREF="#ref5">check</A></b> (long maxwait = -1)
</LI>
<LI>virtual bool <b><A HREF="#ref6">unlockAll</A></b> ()
</LI>
</ul><h4>Public Static Methods</h4><ul><LI>static void <b><A HREF="#ref7">wait</A></b> (unsigned long maxwait)
</LI>
<LI>static unsigned long <b><A HREF="#ref8">wait</A></b> ()
</LI>
<LI>static void <b><A HREF="#ref9">startUsingNow</A></b> ()
</LI>
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
An abstract base class for implementing lockable objects
</p>
<A NAME="~Lockable"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>~Lockable</strong> ()
<br></td><td align="right"><h3><strong>~Lockable</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
Destructor
</p>
<A NAME="lock"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <i><strong>lock</strong></i> (long maxwait = -1)
<br></td><td align="right"><h3><i><strong>lock</strong></i></h3></td></tr></table><p> <small>[pure virtual]</small></p><p>
Attempt to lock the object and eventually wait for it
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>maxwait</i></TD><TD align="left" valign="top">Time in microseconds to wait, -1 wait forever
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if successfully locked, false on failure
</p>
<A NAME="unlock"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <i><strong>unlock</strong></i> ()
<br></td><td align="right"><h3><i><strong>unlock</strong></i></h3></td></tr></table><p> <small>[pure virtual]</small></p><p>
Unlock the object, does never wait
</p>
<p><b>Returns</b>: True if successfully unlocked the object
</p>
<A NAME="locked"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <i><strong>locked</strong></i> ()
<br></td><td align="right"><h3><i><strong>locked</strong></i></h3></td></tr></table><p> <small>[const pure virtual]</small></p><p>
Check if the object is currently locked - as it's asynchronous it
guarantees nothing if other thread changes the status
</p>
<p><b>Returns</b>: True if the object was locked when the function was called
</p>
<A NAME="check"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>check</strong> (long maxwait = -1)
<br></td><td align="right"><h3><strong>check</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
Check if the object is unlocked (try to lock and unlock it)
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>maxwait</i></TD><TD align="left" valign="top">Time in microseconds to wait, -1 to wait forever
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if successfully locked and unlocked, false on failure
</p>
<A NAME="unlockAll"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>unlockAll</strong> ()
<br></td><td align="right"><h3><strong>unlockAll</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
Fully unlock the object, even if it was previously multiple locked.
There is no guarantee about the object status after the function returns.
This function should be used only if you understand it very well
</p>
<p><b>Returns</b>: True if the object was fully unlocked
</p>
<A NAME="wait"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td> void <strong>wait</strong> (unsigned long maxwait)
<br></td><td align="right"><h3><strong>wait</strong></h3></td></tr></table><p> <small>[static]</small></p><p>
Set a maximum wait time for debugging purposes
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>maxwait</i></TD><TD align="left" valign="top">Maximum time in microseconds to wait for any lockable
object when no time limit was requested, zero to disable limit
</TD></TR>
</TABLE></P>
<A NAME="wait"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td> unsigned long <strong>wait</strong> ()
<br></td><td align="right"><h3><strong>wait</strong></h3></td></tr></table><p> <small>[static]</small></p><p>
Get the maximum wait time used for debugging purposes
</p>
<p><b>Returns</b>: Maximum time in microseconds, zero if no maximum is set
</p>
<A NAME="startUsingNow"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td> void <strong>startUsingNow</strong> ()
<br></td><td align="right"><h3><strong>startUsingNow</strong></h3></td></tr></table><p> <small>[static]</small></p><p>
Start actually using lockables, for platforms where these objects are not
usable in global object constructors.
This method must be called at least once somewhere from main() but
before creating any threads and without holding any object locked.
</p>
<HR>
<table>
<tr><td><small>Generated by: paulc on bussard on Mon Mar 8 12:18:15 2010, using kdoc 2.0a54.</small></td></tr>
</table>
</BODY>
</HTML>
|