l4re-base-25.08.0

This commit is contained in:
2025-09-12 15:55:45 +02:00
commit d959eaab98
37938 changed files with 9382688 additions and 0 deletions

View File

@@ -0,0 +1,336 @@
<!-- HTML header for doxygen 1.9.1-->
<!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.15.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>L4Re Operating System Framework: L4::Lock_guard 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="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="l4re-awesome.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="projectlogo"><img alt="Logo" src="L4Re_rgb_logo_quer_hg_h55.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">L4Re Operating System Framework
</div>
<div id="projectbrief">Interface and Usage Documentation</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.15.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
</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">
$(function(){initNavTree('classL4_1_1Lock__guard.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">L4::Lock_guard Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Basic lock guard implementation that prevents forgotten unlocks on exit paths from a method or a block of code.
<a href="#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="lock__guard_8h_source.html">lock_guard.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return dynsection.toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"><span class="dynarrow"><span class="arrowhead closed"></span></span>Collaboration diagram for L4::Lock_guard:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" loading="lazy" frameborder="0" src="classL4_1_1Lock__guard__coll__graph.svg" width="135" height="156"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-pub-methods" class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a39dc4304fc0e663c3992d7985f2527b8" id="r_a39dc4304fc0e663c3992d7985f2527b8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a39dc4304fc0e663c3992d7985f2527b8">Lock_guard</a> (pthread_mutex_t &amp;lock)</td></tr>
<tr class="memdesc:a39dc4304fc0e663c3992d7985f2527b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct the lock guard and lock the associated mutex. <br /></td></tr>
<tr class="memitem:a123c051b051fc44443dba6d5c6abf389" id="r_a123c051b051fc44443dba6d5c6abf389"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a123c051b051fc44443dba6d5c6abf389">Lock_guard</a> (<a class="el" href="classL4_1_1Lock__guard.html">Lock_guard</a> &amp;&amp;guard)</td></tr>
<tr class="memdesc:a123c051b051fc44443dba6d5c6abf389"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move constructor from other lock guard. <br /></td></tr>
<tr class="memitem:a86f052391b9f2b9917b915b84a85bbbc" id="r_a86f052391b9f2b9917b915b84a85bbbc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classL4_1_1Lock__guard.html">Lock_guard</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a86f052391b9f2b9917b915b84a85bbbc">operator=</a> (<a class="el" href="classL4_1_1Lock__guard.html">Lock_guard</a> &amp;&amp;guard)</td></tr>
<tr class="memdesc:a86f052391b9f2b9917b915b84a85bbbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move assignment from other lock guard. <br /></td></tr>
<tr class="memitem:ad763c179d4461e6e9ead650eab592fe6" id="r_ad763c179d4461e6e9ead650eab592fe6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad763c179d4461e6e9ead650eab592fe6">status</a> () const</td></tr>
<tr class="memdesc:ad763c179d4461e6e9ead650eab592fe6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return last lock/unlock operation error status. <br /></td></tr>
<tr class="memitem:a4ed9d5906e2f88e515d6bb7c03555752" id="r_a4ed9d5906e2f88e515d6bb7c03555752"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4ed9d5906e2f88e515d6bb7c03555752">~Lock_guard</a> ()</td></tr>
<tr class="memdesc:a4ed9d5906e2f88e515d6bb7c03555752"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lock guard destructor. <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Basic lock guard implementation that prevents forgotten unlocks on exit paths from a method or a block of code. </p>
<p>Targeting <span class="tt">pthread_mutex_t</span>.</p>
<p>An instance of lock guard cannot be copied, but it can be moved.</p>
<p>The typical usage pattern of the lock guard is:</p>
<div class="fragment"><div class="line">pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;</div>
<div class="line"> </div>
<div class="line">{</div>
<div class="line"> <span class="keyword">auto</span> guard = L4Re::Lock_guard(mtx);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Correctness check.</span></div>
<div class="line"> assert(guard.status() == 0);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Critical section protected by mtx.</span></div>
<div class="line"> </div>
<div class="line"> <span class="comment">// The mtx is automatically unlocked when guard goes out of scope.</span></div>
<div class="line">}</div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="lock__guard_8h_source.html#l00044">44</a> of file <a class="el" href="lock__guard_8h_source.html">lock_guard.h</a>.</p>
</div><a name="doc-constructors" id="doc-constructors"></a><h2 id="header-doc-constructors" class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a39dc4304fc0e663c3992d7985f2527b8" name="a39dc4304fc0e663c3992d7985f2527b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39dc4304fc0e663c3992d7985f2527b8">&#9670;&#160;</a></span>Lock_guard() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">L4::Lock_guard::Lock_guard </td>
<td>(</td>
<td class="paramtype">pthread_mutex_t &amp;</td> <td class="paramname"><span class="paramname"><em>lock</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel explicit">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct the lock guard and lock the associated mutex. </p>
<p>The error condition of the locking operation can be checked by the <a class="el" href="#ad763c179d4461e6e9ead650eab592fe6" title="Return last lock/unlock operation error status.">status()</a> method.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">lock</td><td>Associated mutex to be locked. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="lock__guard_8h_source.html#l00059">59</a> of file <a class="el" href="lock__guard_8h_source.html">lock_guard.h</a>.</p>
</div>
</div>
<a id="a123c051b051fc44443dba6d5c6abf389" name="a123c051b051fc44443dba6d5c6abf389"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a123c051b051fc44443dba6d5c6abf389">&#9670;&#160;</a></span>Lock_guard() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">L4::Lock_guard::Lock_guard </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classL4_1_1Lock__guard.html">Lock_guard</a> &amp;&amp;</td> <td class="paramname"><span class="paramname"><em>guard</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Move constructor from other lock guard. </p>
<p>The mutex associated with the other lock guard is kept locked.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">guard</td><td>Lock guard to be moved. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="lock__guard_8h_source.html#l00071">71</a> of file <a class="el" href="lock__guard_8h_source.html">lock_guard.h</a>.</p>
</div>
</div>
<a id="a4ed9d5906e2f88e515d6bb7c03555752" name="a4ed9d5906e2f88e515d6bb7c03555752"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ed9d5906e2f88e515d6bb7c03555752">&#9670;&#160;</a></span>~Lock_guard()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">L4::Lock_guard::~Lock_guard </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Lock guard destructor. </p>
<p>The associated mutex (if any) is unlocked.</p>
<p>There is no mechanism for indicating any error conditions. However, if the mutex has been previously locked successfully by this class and if the implementation of the mutex behaves according to the POSIX specification, the construction of this class guarantees that the unlock operation does not fail. </p>
<p class="definition">Definition at line <a class="el" href="lock__guard_8h_source.html#l00126">126</a> of file <a class="el" href="lock__guard_8h_source.html">lock_guard.h</a>.</p>
</div>
</div>
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Member Function Documentation</h2>
<a id="a86f052391b9f2b9917b915b84a85bbbc" name="a86f052391b9f2b9917b915b84a85bbbc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a86f052391b9f2b9917b915b84a85bbbc">&#9670;&#160;</a></span>operator=()</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="classL4_1_1Lock__guard.html">Lock_guard</a> &amp; L4::Lock_guard::operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classL4_1_1Lock__guard.html">Lock_guard</a> &amp;&amp;</td> <td class="paramname"><span class="paramname"><em>guard</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Move assignment from other lock guard. </p>
<p>The mutex currently associated with this lock guard is unlocked. The mutex associated with the other lock guard is kept locked.</p>
<p>There is no mechanism for indicating any error conditions of the unlocking operation. However, if the mutex has been previously locked successfully by this class and if the implementation of the mutex behaves according to the POSIX specification, the construction of this class guarantees that the unlock operation does not fail.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">guard</td><td>Lock guard to be moved. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="lock__guard_8h_source.html#l00090">90</a> of file <a class="el" href="lock__guard_8h_source.html">lock_guard.h</a>.</p>
</div>
</div>
<a id="ad763c179d4461e6e9ead650eab592fe6" name="ad763c179d4461e6e9ead650eab592fe6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad763c179d4461e6e9ead650eab592fe6">&#9670;&#160;</a></span>status()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int L4::Lock_guard::status </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return last lock/unlock operation error status. </p>
<dl class="section return"><dt>Returns</dt><dd>Zero indicating no errors, any other value indicating an error. </dd></dl>
<p class="definition">Definition at line <a class="el" href="lock__guard_8h_source.html#l00110">110</a> of file <a class="el" href="lock__guard_8h_source.html">lock_guard.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>l4/cxx/<a class="el" href="lock__guard_8h_source.html">lock_guard.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- HTML footer for doxygen 1.9.1-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a href="namespaceL4.html">L4</a></li><li class="navelem"><a href="classL4_1_1Lock__guard.html">Lock_guard</a></li>
<li class="footer">Generated on <span class="timestamp"></span> for L4Re Operating System Framework by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.15.0 </li>
</ul>
</div>
</body>
</html>