<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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"/> <meta name="generator" content="Doxygen 1.8.15"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>libzypp: zypp::thread::Mutex Class Reference</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="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(initResizable); /* @license-end */</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 id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">libzypp  <span id="projectnumber">17.9.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.15 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></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"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function(){initNavTree('classzypp_1_1thread_1_1Mutex.html','');}); /* @license-end */ </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pri-attribs">Private Attributes</a> | <a href="classzypp_1_1thread_1_1Mutex-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">zypp::thread::Mutex Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>A recursive <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a>. <a href="classzypp_1_1thread_1_1Mutex.html#details">More...</a></p> <p><code>#include <<a class="el" href="Mutex_8h_source.html">Mutex.h</a>></code></p> <div class="dynheader"> Inheritance diagram for zypp::thread::Mutex:</div> <div class="dyncontent"> <div class="center"><img src="classzypp_1_1thread_1_1Mutex__inherit__graph.png" border="0" usemap="#zypp_1_1thread_1_1Mutex_inherit__map" alt="Inheritance graph"/></div> <map name="zypp_1_1thread_1_1Mutex_inherit__map" id="zypp_1_1thread_1_1Mutex_inherit__map"> <area shape="rect" title="A recursive Mutex." alt="" coords="23,80,165,107"/> <area shape="rect" title=" " alt="" coords="5,5,183,32"/> </map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a86713b093220d070876a9b54162f999f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1thread_1_1Mutex.html#a86713b093220d070876a9b54162f999f">Mutex</a> ()</td></tr> <tr class="memdesc:a86713b093220d070876a9b54162f999f"><td class="mdescLeft"> </td><td class="mdescRight">Create a new recursive <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. <a href="#a86713b093220d070876a9b54162f999f">More...</a><br /></td></tr> <tr class="separator:a86713b093220d070876a9b54162f999f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a190d2ec796d5094c4bfd82e2337cf1ec"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1thread_1_1Mutex.html#a190d2ec796d5094c4bfd82e2337cf1ec">~Mutex</a> ()</td></tr> <tr class="memdesc:a190d2ec796d5094c4bfd82e2337cf1ec"><td class="mdescLeft"> </td><td class="mdescRight">Destroys this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. <a href="#a190d2ec796d5094c4bfd82e2337cf1ec">More...</a><br /></td></tr> <tr class="separator:a190d2ec796d5094c4bfd82e2337cf1ec"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a526df3ba9d1e7ddd873875b296f27e31"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1thread_1_1Mutex.html#a526df3ba9d1e7ddd873875b296f27e31">lock</a> ()</td></tr> <tr class="memdesc:a526df3ba9d1e7ddd873875b296f27e31"><td class="mdescLeft"> </td><td class="mdescRight">Acquire ownership of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. <a href="#a526df3ba9d1e7ddd873875b296f27e31">More...</a><br /></td></tr> <tr class="separator:a526df3ba9d1e7ddd873875b296f27e31"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a120e6cbbd9e41f5637d0f20526698fb6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1thread_1_1Mutex.html#a120e6cbbd9e41f5637d0f20526698fb6">unlock</a> ()</td></tr> <tr class="memdesc:a120e6cbbd9e41f5637d0f20526698fb6"><td class="mdescLeft"> </td><td class="mdescRight">Release ownership of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. <a href="#a120e6cbbd9e41f5637d0f20526698fb6">More...</a><br /></td></tr> <tr class="separator:a120e6cbbd9e41f5637d0f20526698fb6"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2e157590ce02f9a61ca95485f1b29698"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbool.html">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1thread_1_1Mutex.html#a2e157590ce02f9a61ca95485f1b29698">trylock</a> ()</td></tr> <tr class="memdesc:a2e157590ce02f9a61ca95485f1b29698"><td class="mdescLeft"> </td><td class="mdescRight">Try to acquire ownership of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. <a href="#a2e157590ce02f9a61ca95485f1b29698">More...</a><br /></td></tr> <tr class="separator:a2e157590ce02f9a61ca95485f1b29698"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a> Private Attributes</h2></td></tr> <tr class="memitem:a8a80b2917417e736b582480711102ce8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacezypp_1_1thread.html#ac9b800b201250bb0601aca804be1980e">RecursiveMutex_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classzypp_1_1thread_1_1Mutex.html#a8a80b2917417e736b582480711102ce8">m_mutex</a></td></tr> <tr class="separator:a8a80b2917417e736b582480711102ce8"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A recursive <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a>. </p> <p class="definition">Definition at line <a class="el" href="Mutex_8h_source.html#l00035">35</a> of file <a class="el" href="Mutex_8h_source.html">Mutex.h</a>.</p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a id="a86713b093220d070876a9b54162f999f"></a> <h2 class="memtitle"><span class="permalink"><a href="#a86713b093220d070876a9b54162f999f">◆ </a></span>Mutex()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">zypp::thread::Mutex::Mutex </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Create a new recursive <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. </p> <dl class="exception"><dt>Exceptions</dt><dd> <table class="exception"> <tr><td class="paramname"><a class="el" href="classzypp_1_1thread_1_1MutexException.html" title="Exception type thrown on mutex errors.">MutexException</a></td><td>on initialization failure. </td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="Mutex_8cc_source.html#l00025">25</a> of file <a class="el" href="Mutex_8cc_source.html">Mutex.cc</a>.</p> </div> </div> <a id="a190d2ec796d5094c4bfd82e2337cf1ec"></a> <h2 class="memtitle"><span class="permalink"><a href="#a190d2ec796d5094c4bfd82e2337cf1ec">◆ </a></span>~Mutex()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">zypp::thread::Mutex::~Mutex </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destroys this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. </p> <p class="definition">Definition at line <a class="el" href="Mutex_8cc_source.html#l00052">52</a> of file <a class="el" href="Mutex_8cc_source.html">Mutex.cc</a>.</p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a id="a526df3ba9d1e7ddd873875b296f27e31"></a> <h2 class="memtitle"><span class="permalink"><a href="#a526df3ba9d1e7ddd873875b296f27e31">◆ </a></span>lock()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void zypp::thread::Mutex::lock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Acquire ownership of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. </p> <p>This call will block if another thread has ownership of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a>. When it returns, the current thread is the owner of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object.</p> <p>In the same thread, this recursive mutex can be acquired multiple times.</p> <dl class="exception"><dt>Exceptions</dt><dd> <table class="exception"> <tr><td class="paramname"><a class="el" href="classzypp_1_1thread_1_1MutexException.html" title="Exception type thrown on mutex errors.">MutexException</a></td><td>if the maximum number of recursive locks for mutex has been exceeded. </td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="Mutex_8cc_source.html#l00072">72</a> of file <a class="el" href="Mutex_8cc_source.html">Mutex.cc</a>.</p> </div> </div> <a id="a120e6cbbd9e41f5637d0f20526698fb6"></a> <h2 class="memtitle"><span class="permalink"><a href="#a120e6cbbd9e41f5637d0f20526698fb6">◆ </a></span>unlock()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void zypp::thread::Mutex::unlock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Release ownership of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. </p> <p>If another thread is waiting to acquire the ownership of this mutex it will stop blocking and acquire ownership when this call returns.</p> <dl class="exception"><dt>Exceptions</dt><dd> <table class="exception"> <tr><td class="paramname"><a class="el" href="classzypp_1_1thread_1_1MutexException.html" title="Exception type thrown on mutex errors.">MutexException</a></td><td>if the current thread does not own the mutex. </td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="Mutex_8cc_source.html#l00082">82</a> of file <a class="el" href="Mutex_8cc_source.html">Mutex.cc</a>.</p> </div> </div> <a id="a2e157590ce02f9a61ca95485f1b29698"></a> <h2 class="memtitle"><span class="permalink"><a href="#a2e157590ce02f9a61ca95485f1b29698">◆ </a></span>trylock()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classbool.html">bool</a> zypp::thread::Mutex::trylock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Try to acquire ownership of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object. </p> <p>This call will return false if another thread has ownership of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> or the maximum number of recursive locks for mutex has been exceeded. When it returns true, the current thread is the owner of this <a class="el" href="classzypp_1_1thread_1_1Mutex.html" title="A recursive Mutex.">Mutex</a> object.</p> <dl class="section return"><dt>Returns</dt><dd>true, if ownership was acquired. </dd></dl> <p class="definition">Definition at line <a class="el" href="Mutex_8cc_source.html#l00092">92</a> of file <a class="el" href="Mutex_8cc_source.html">Mutex.cc</a>.</p> </div> </div> <h2 class="groupheader">Member Data Documentation</h2> <a id="a8a80b2917417e736b582480711102ce8"></a> <h2 class="memtitle"><span class="permalink"><a href="#a8a80b2917417e736b582480711102ce8">◆ </a></span>m_mutex</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="namespacezypp_1_1thread.html#ac9b800b201250bb0601aca804be1980e">RecursiveMutex_t</a> zypp::thread::Mutex::m_mutex</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">private</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="Mutex_8h_source.html#l00082">82</a> of file <a class="el" href="Mutex_8h_source.html">Mutex.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li>zypp/thread/<a class="el" href="Mutex_8h_source.html">Mutex.h</a></li> <li>zypp/thread/<a class="el" href="Mutex_8cc_source.html">Mutex.cc</a></li> </ul> </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="namespacezypp.html">zypp</a></li><li class="navelem"><a class="el" href="namespacezypp_1_1thread.html">thread</a></li><li class="navelem"><a class="el" href="classzypp_1_1thread_1_1Mutex.html">Mutex</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li> </ul> </div> </body> </html>