|  | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 
|  | <html xmlns="http://www.w3.org/1999/xhtml"> | 
|  | <head> | 
|  | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> | 
|  | <meta http-equiv="X-UA-Compatible" content="IE=9"/> | 
|  | <title>activemq-cpp-3.6.0: src/main/decaf/util/concurrent/Lock.h Source File</title> | 
|  | <link href="tabs.css" rel="stylesheet" type="text/css"/> | 
|  | <script type="text/javascript" src="jquery.js"></script> | 
|  | <script type="text/javascript" src="dynsections.js"></script> | 
|  | <link href="navtree.css" rel="stylesheet" type="text/css"/> | 
|  | <script type="text/javascript" src="resize.js"></script> | 
|  | <script type="text/javascript" src="navtree.js"></script> | 
|  | <script type="text/javascript"> | 
|  | $(document).ready(initResizable); | 
|  | </script> | 
|  | <link href="doxygen.css" rel="stylesheet" type="text/css" /> | 
|  | </head> | 
|  | <body> | 
|  | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> | 
|  | <div id="titlearea"> | 
|  | <table cellspacing="0" cellpadding="0"> | 
|  | <tbody> | 
|  | <tr style="height: 56px;"> | 
|  | <td style="padding-left: 0.5em;"> | 
|  | <div id="projectname">activemq-cpp-3.6.0 | 
|  | </div> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </div> | 
|  | <!-- end header part --> | 
|  | <!-- Generated by Doxygen 1.8.1.2 --> | 
|  | <div id="navrow1" class="tabs"> | 
|  | <ul class="tablist"> | 
|  | <li><a href="index.html"><span>Main Page</span></a></li> | 
|  | <li><a href="namespaces.html"><span>Namespaces</span></a></li> | 
|  | <li><a href="annotated.html"><span>Data Structures</span></a></li> | 
|  | <li class="current"><a href="files.html"><span>Files</span></a></li> | 
|  | </ul> | 
|  | </div> | 
|  | <div id="navrow2" class="tabs2"> | 
|  | <ul class="tablist"> | 
|  | <li><a href="files.html"><span>File List</span></a></li> | 
|  | <li><a href="globals.html"><span>Globals</span></a></li> | 
|  | </ul> | 
|  | </div> | 
|  | </div><!-- top --> | 
|  | <div id="side-nav" class="ui-resizable side-nav-resizable"> | 
|  | <div id="nav-tree"> | 
|  | <div id="nav-tree-contents"> | 
|  | <div id="nav-sync" class="sync"></div> | 
|  | </div> | 
|  | </div> | 
|  | <div id="splitbar" style="-moz-user-select:none;" | 
|  | class="ui-resizable-handle"> | 
|  | </div> | 
|  | </div> | 
|  | <script type="text/javascript"> | 
|  | $(document).ready(function(){initNavTree('_lock_8h_source.html','');}); | 
|  | </script> | 
|  | <div id="doc-content"> | 
|  | <div class="header"> | 
|  | <div class="headertitle"> | 
|  | <div class="title">Lock.h</div>  </div> | 
|  | </div><!--header--> | 
|  | <div class="contents"> | 
|  | <a href="_lock_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/*</span></div> | 
|  | <div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</span></div> | 
|  | <div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * contributor license agreements.  See the NOTICE file distributed with</span></div> | 
|  | <div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * this work for additional information regarding copyright ownership.</span></div> | 
|  | <div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span></div> | 
|  | <div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * (the "License"); you may not use this file except in compliance with</span></div> | 
|  | <div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * the License.  You may obtain a copy of the License at</span></div> | 
|  | <div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> *</span></div> | 
|  | <div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> *     http://www.apache.org/licenses/LICENSE-2.0</span></div> | 
|  | <div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div> | 
|  | <div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div> | 
|  | <div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span></div> | 
|  | <div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div> | 
|  | <div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * See the License for the specific language governing permissions and</span></div> | 
|  | <div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> * limitations under the License.</span></div> | 
|  | <div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> */</span></div> | 
|  | <div class="line"><a name="l00017"></a><span class="lineno">   17</span> </div> | 
|  | <div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="preprocessor">#ifndef _DECAF_UTIL_CONCURRENT_LOCK_H_</span></div> | 
|  | <div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="preprocessor"></span><span class="preprocessor">#define _DECAF_UTIL_CONCURRENT_LOCK_H_</span></div> | 
|  | <div class="line"><a name="l00020"></a><span class="lineno">   20</span> <span class="preprocessor"></span></div> | 
|  | <div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="preprocessor">#include <<a class="code" href="_synchronizable_8h.html">decaf/util/concurrent/Synchronizable.h</a>></span></div> | 
|  | <div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="preprocessor">#include <<a class="code" href="decaf_2util_2_config_8h.html">decaf/util/Config.h</a>></span></div> | 
|  | <div class="line"><a name="l00023"></a><span class="lineno">   23</span> </div> | 
|  | <div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="keyword">namespace </span>decaf{</div> | 
|  | <div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="keyword">namespace </span>util{</div> | 
|  | <div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="keyword">namespace </span>concurrent{</div> | 
|  | <div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div> | 
|  | <div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html">   34</a></span>     <span class="keyword">class </span><a class="code" href="decaf_2util_2_config_8h.html#a8823395a34e3cba9af2a3d11968f3b37">DECAF_API</a> <a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html" title="A wrapper class around a given synchronization mechanism that provides automatic release upon destruc...">Lock</a> {</div> | 
|  | <div class="line"><a name="l00035"></a><span class="lineno">   35</span>     <span class="keyword">private</span>:</div> | 
|  | <div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div> | 
|  | <div class="line"><a name="l00041"></a><span class="lineno">   41</span>         <span class="keyword">volatile</span> <span class="keywordtype">bool</span> locked;</div> | 
|  | <div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div> | 
|  | <div class="line"><a name="l00046"></a><span class="lineno">   46</span>         <a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_synchronizable.html" title="The interface for all synchronizable objects (that is, objects that can be locked and unlocked)...">Synchronizable</a>* syncObject;</div> | 
|  | <div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div> | 
|  | <div class="line"><a name="l00048"></a><span class="lineno">   48</span>     <span class="keyword">private</span>:</div> | 
|  | <div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div> | 
|  | <div class="line"><a name="l00050"></a><span class="lineno">   50</span>         <a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html" title="A wrapper class around a given synchronization mechanism that provides automatic release upon destruc...">Lock</a>( <span class="keyword">const</span> <a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html" title="A wrapper class around a given synchronization mechanism that provides automatic release upon destruc...">Lock</a>& src );</div> | 
|  | <div class="line"><a name="l00051"></a><span class="lineno">   51</span>         <a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html" title="A wrapper class around a given synchronization mechanism that provides automatic release upon destruc...">Lock</a>& operator= ( <span class="keyword">const</span> <a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html" title="A wrapper class around a given synchronization mechanism that provides automatic release upon destruc...">Lock</a>& src );</div> | 
|  | <div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div> | 
|  | <div class="line"><a name="l00053"></a><span class="lineno">   53</span>     <span class="keyword">public</span>:</div> | 
|  | <div class="line"><a name="l00054"></a><span class="lineno">   54</span> </div> | 
|  | <div class="line"><a name="l00064"></a><span class="lineno">   64</span>         <a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html" title="A wrapper class around a given synchronization mechanism that provides automatic release upon destruc...">Lock</a>( <a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_synchronizable.html" title="The interface for all synchronizable objects (that is, objects that can be locked and unlocked)...">Synchronizable</a>* <span class="keywordtype">object</span>, <span class="keyword">const</span> <span class="keywordtype">bool</span> intiallyLocked = <span class="keyword">true</span> );</div> | 
|  | <div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div> | 
|  | <div class="line"><a name="l00069"></a><span class="lineno">   69</span>         <span class="keyword">virtual</span> ~<a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html" title="A wrapper class around a given synchronization mechanism that provides automatic release upon destruc...">Lock</a>();</div> | 
|  | <div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div> | 
|  | <div class="line"><a name="l00074"></a><span class="lineno">   74</span>         <span class="keywordtype">void</span> lock();</div> | 
|  | <div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div> | 
|  | <div class="line"><a name="l00080"></a><span class="lineno">   80</span>         <span class="keywordtype">void</span> unlock();</div> | 
|  | <div class="line"><a name="l00081"></a><span class="lineno">   81</span> </div> | 
|  | <div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html#ad06c5e6a89953fc8b9868ffb7ce5ec20">   86</a></span>         <span class="keywordtype">bool</span> <a class="code" href="classdecaf_1_1util_1_1concurrent_1_1_lock.html#ad06c5e6a89953fc8b9868ffb7ce5ec20" title="Indicates whether or not the object is locked.">isLocked</a>()<span class="keyword"> const</span>{ <span class="keywordflow">return</span> locked; }</div> | 
|  | <div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div> | 
|  | <div class="line"><a name="l00088"></a><span class="lineno">   88</span>     };</div> | 
|  | <div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div> | 
|  | <div class="line"><a name="l00090"></a><span class="lineno">   90</span> }}}</div> | 
|  | <div class="line"><a name="l00091"></a><span class="lineno">   91</span> </div> | 
|  | <div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">#endif // _DECAF_UTIL_CONCURRENT_LOCK_H_</span></div> | 
|  | </div><!-- fragment --></div><!-- contents --> | 
|  | </div><!-- doc-content --> | 
|  | <!-- start footer part --> | 
|  | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> | 
|  | <ul> | 
|  | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_5eb159725f84c66aafd839904a4acdd0.html">main</a></li><li class="navelem"><a class="el" href="dir_13f053920e46084fbd256a40b4d27221.html">decaf</a></li><li class="navelem"><a class="el" href="dir_15ca907242872ce0b98213244791ee53.html">util</a></li><li class="navelem"><a class="el" href="dir_4dd16b2dac6bad25b30abab29dd219da.html">concurrent</a></li><li class="navelem"><a class="el" href="_lock_8h.html">Lock.h</a></li> | 
|  | <li class="footer">Generated on Mon Mar 4 2013 10:25:46 for activemq-cpp-3.6.0 by | 
|  | <a href="http://www.doxygen.org/index.html"> | 
|  | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.2 </li> | 
|  | </ul> | 
|  | </div> | 
|  | </body> | 
|  | </html> |