<!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"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Evo C++ Library v0.5.1: AtomicFlag Struct 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="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">Evo C++ Library v0.5.1
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceevo.html">evo</a></li><li class="navelem"><a class="el" href="structevo_1_1_atomic_flag.html">AtomicFlag</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="structevo_1_1_atomic_flag-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">AtomicFlag Struct Reference<div class="ingroups"><a class="el" href="group___evo_thread.html">EvoThread</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="atomic_8h_source.html">evo/atomic.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for AtomicFlag:</div>
<div class="dyncontent">
<div class="center"><img src="structevo_1_1_atomic_flag__inherit__graph.png" border="0" usemap="#_atomic_flag_inherit__map" alt="Inheritance graph"/></div>
<map name="_atomic_flag_inherit__map" id="_atomic_flag_inherit__map">
<area shape="rect" id="node3" href="structevo_1_1_spin_lock.html" title="Spin&#45;lock for thread synchronization. " alt="" coords="15,155,95,181"/>
<area shape="rect" id="node4" href="structevo_1_1_sleep_lock.html" title="Variation of SpinLock for thread synchronization using sleep&#45;wait. " alt="" coords="11,229,99,256"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Atomic signalling flag. </p>
<ul>
<li>All methods and operators are atomic (thread safe)</li>
<li>This can be used as a spin-lock, though better to use <a class="el" href="structevo_1_1_spin_lock.html" title="Spin-lock for thread synchronization. ">SpinLock</a> for code clarity</li>
<li>This intentionally has a limited interface, use <a class="el" href="group___evo_thread.html#ga8be38b290f41efef27f5dd5cb0210167">AtomicInt</a> for a more standard atomic bool value</li>
</ul>
</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:ga3643f1afc14f74ed7d20d20ebfbb646b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___evo_thread.html#ga3643f1afc14f74ed7d20d20ebfbb646b">AtomicFlag</a> ()</td></tr>
<tr class="separator:ga3643f1afc14f74ed7d20d20ebfbb646b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06210347b94e80834b4faf3da5a26425"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___evo_thread.html#ga06210347b94e80834b4faf3da5a26425">clear</a> (<a class="el" href="group___evo_thread.html#ga8e4490d89234f5a6ce11a593be184514">MemOrder</a> mem_order=std::memory_order_seq_cst)</td></tr>
<tr class="memdesc:ga06210347b94e80834b4faf3da5a26425"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear flag (set to false).  <a href="group___evo_thread.html#ga06210347b94e80834b4faf3da5a26425">More...</a><br /></td></tr>
<tr class="separator:ga06210347b94e80834b4faf3da5a26425"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa81aed607133209dade63a226818224d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___evo_thread.html#gaa81aed607133209dade63a226818224d">lock</a> ()</td></tr>
<tr class="memdesc:gaa81aed607133209dade63a226818224d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Spin-lock flag.  <a href="group___evo_thread.html#gaa81aed607133209dade63a226818224d">More...</a><br /></td></tr>
<tr class="separator:gaa81aed607133209dade63a226818224d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga94298992403f79ff3f2b681ee4458524"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___evo_thread.html#ga94298992403f79ff3f2b681ee4458524">sleeplock</a> (ulong ms=1)</td></tr>
<tr class="memdesc:ga94298992403f79ff3f2b681ee4458524"><td class="mdescLeft">&#160;</td><td class="mdescRight">Spin-lock flag with a sleep.  <a href="group___evo_thread.html#ga94298992403f79ff3f2b681ee4458524">More...</a><br /></td></tr>
<tr class="separator:ga94298992403f79ff3f2b681ee4458524"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4a5822d1156be4bddc9d0d8db089c4fa"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___evo_thread.html#ga4a5822d1156be4bddc9d0d8db089c4fa">test_and_set</a> (<a class="el" href="group___evo_thread.html#ga8e4490d89234f5a6ce11a593be184514">MemOrder</a> mem_order=std::memory_order_seq_cst)</td></tr>
<tr class="memdesc:ga4a5822d1156be4bddc9d0d8db089c4fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Atomically set flag (to true) and return the previous value.  <a href="group___evo_thread.html#ga4a5822d1156be4bddc9d0d8db089c4fa">More...</a><br /></td></tr>
<tr class="separator:ga4a5822d1156be4bddc9d0d8db089c4fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9278be8203e1c42e2619179882ae4403"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___evo_thread.html#ga9278be8203e1c42e2619179882ae4403">unlock</a> ()</td></tr>
<tr class="memdesc:ga9278be8203e1c42e2619179882ae4403"><td class="mdescLeft">&#160;</td><td class="mdescRight">Spin-unlock flag.  <a href="group___evo_thread.html#ga9278be8203e1c42e2619179882ae4403">More...</a><br /></td></tr>
<tr class="separator:ga9278be8203e1c42e2619179882ae4403"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>evo/<a class="el" href="atomic_8h_source.html">atomic.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue May 7 2019 18:17:32 for Evo C++ Library v0.5.1 by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
