1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Struct template multi_thread_model</title> 5<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Log v2"> 8<link rel="up" href="../../../logging_sources.html#header.boost.log.sources.threading_models_hpp" title="Header <boost/log/sources/threading_models.hpp>"> 9<link rel="prev" href="wseverity_logger_mt.html" title="Class template wseverity_logger_mt"> 10<link rel="next" href="single_thread_model.html" title="Struct single_thread_model"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td></tr></table> 14<hr> 15<div class="spirit-nav"> 16<a accesskey="p" href="wseverity_logger_mt.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../logging_sources.html#header.boost.log.sources.threading_models_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="single_thread_model.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 17</div> 18<div class="refentry"> 19<a name="boost.log.sources.multi_thread_model"></a><div class="titlepage"></div> 20<div class="refnamediv"> 21<h2><span class="refentrytitle">Struct template multi_thread_model</span></h2> 22<p>boost::log::sources::multi_thread_model — Multi-thread locking model with maximum locking capabilities. </p> 23</div> 24<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 25<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../../logging_sources.html#header.boost.log.sources.threading_models_hpp" title="Header <boost/log/sources/threading_models.hpp>">boost/log/sources/threading_models.hpp</a>> 26 27</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> MutexT<span class="special">></span> 28<span class="keyword">struct</span> <a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">{</span> 29 <span class="comment">// <a class="link" href="multi_thread_model.html#boost.log.sources.multi_thread_modelconstruct-copy-destruct">construct/copy/destruct</a></span> 30 <a class="link" href="multi_thread_model.html#idm46079577347616-bb"><span class="identifier">multi_thread_model</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_nothrow_constructor</span><span class="special"><</span> <span class="identifier">MutexT</span> <span class="special">></span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">)</span><span class="special">;</span> 31 <a class="link" href="multi_thread_model.html#idm46079577347008-bb"><span class="identifier">multi_thread_model</span></a><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_nothrow_constructor</span><span class="special"><</span> <span class="identifier">MutexT</span> <span class="special">></span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">)</span><span class="special">;</span> 32 <a class="link" href="multi_thread_model.html#idm46079577343312-bb"><span class="identifier">multi_thread_model</span></a><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_nothrow_constructor</span><span class="special"><</span> <span class="identifier">MutexT</span> <span class="special">></span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">)</span><span class="special">;</span> 33 <a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&</span> <a class="link" href="multi_thread_model.html#idm46079577345424-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 34 <a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&</span> <a class="link" href="multi_thread_model.html#idm46079577341728-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 35 36 <span class="comment">// <a class="link" href="multi_thread_model.html#idm46079577372976-bb">public member functions</a></span> 37 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577372416-bb"><span class="identifier">lock_shared</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 38 <span class="keyword">bool</span> <a class="link" href="multi_thread_model.html#idm46079577371296-bb"><span class="identifier">try_lock_shared</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 39 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> TimeT<span class="special">></span> <span class="keyword">bool</span> <a class="link" href="multi_thread_model.html#idm46079577370176-bb"><span class="identifier">timed_lock_shared</span></a><span class="special">(</span><span class="identifier">TimeT</span> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 40 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577367520-bb"><span class="identifier">unlock_shared</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 41 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577366400-bb"><span class="identifier">lock</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 42 <span class="keyword">bool</span> <a class="link" href="multi_thread_model.html#idm46079577365280-bb"><span class="identifier">try_lock</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 43 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> TimeT<span class="special">></span> <span class="keyword">bool</span> <a class="link" href="multi_thread_model.html#idm46079577364160-bb"><span class="identifier">timed_lock</span></a><span class="special">(</span><span class="identifier">TimeT</span> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 44 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577361504-bb"><span class="identifier">unlock</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 45 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577360384-bb"><span class="identifier">lock_upgrade</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 46 <span class="keyword">bool</span> <a class="link" href="multi_thread_model.html#idm46079577359264-bb"><span class="identifier">try_lock_upgrade</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 47 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> TimeT<span class="special">></span> <span class="keyword">bool</span> <a class="link" href="multi_thread_model.html#idm46079577358144-bb"><span class="identifier">timed_lock_upgrade</span></a><span class="special">(</span><span class="identifier">TimeT</span> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 48 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577355488-bb"><span class="identifier">unlock_upgrade</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 49 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577354368-bb"><span class="identifier">unlock_upgrade_and_lock</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 50 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577353248-bb"><span class="identifier">unlock_and_lock_upgrade</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 51 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577352128-bb"><span class="identifier">unlock_and_lock_shared</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 52 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577351008-bb"><span class="identifier">unlock_upgrade_and_lock_shared</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 53 <span class="keyword">void</span> <a class="link" href="multi_thread_model.html#idm46079577349872-bb"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 54<span class="special">}</span><span class="special">;</span></pre></div> 55<div class="refsect1"> 56<a name="idm44984866843808"></a><h2>Description</h2> 57<div class="refsect2"> 58<a name="idm44984866843392"></a><h3> 59<a name="boost.log.sources.multi_thread_modelconstruct-copy-destruct"></a><code class="computeroutput">multi_thread_model</code> 60 public 61 construct/copy/destruct</h3> 62<div class="orderedlist"><ol class="orderedlist" type="1"> 63<li class="listitem"><pre class="literallayout"><a name="idm46079577347616-bb"></a><span class="identifier">multi_thread_model</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_nothrow_constructor</span><span class="special"><</span> <span class="identifier">MutexT</span> <span class="special">></span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre></li> 64<li class="listitem"><pre class="literallayout"><a name="idm46079577347008-bb"></a><span class="identifier">multi_thread_model</span><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_nothrow_constructor</span><span class="special"><</span> <span class="identifier">MutexT</span> <span class="special">></span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre></li> 65<li class="listitem"><pre class="literallayout"><a name="idm46079577343312-bb"></a><span class="identifier">multi_thread_model</span><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_nothrow_constructor</span><span class="special"><</span> <span class="identifier">MutexT</span> <span class="special">></span><span class="special">::</span><span class="identifier">value</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre></li> 66<li class="listitem"><pre class="literallayout"><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&</span> <a name="idm46079577345424-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li> 67<li class="listitem"><pre class="literallayout"><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&</span> <a name="idm46079577341728-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li> 68</ol></div> 69</div> 70<div class="refsect2"> 71<a name="idm44984866789696"></a><h3> 72<a name="idm46079577372976-bb"></a><code class="computeroutput">multi_thread_model</code> public member functions</h3> 73<div class="orderedlist"><ol class="orderedlist" type="1"> 74<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577372416-bb"></a><span class="identifier">lock_shared</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 75<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46079577371296-bb"></a><span class="identifier">try_lock_shared</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 76<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> TimeT<span class="special">></span> <span class="keyword">bool</span> <a name="idm46079577370176-bb"></a><span class="identifier">timed_lock_shared</span><span class="special">(</span><span class="identifier">TimeT</span> <span class="keyword">const</span> <span class="special">&</span> t<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 77<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577367520-bb"></a><span class="identifier">unlock_shared</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li> 78<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577366400-bb"></a><span class="identifier">lock</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 79<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46079577365280-bb"></a><span class="identifier">try_lock</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 80<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> TimeT<span class="special">></span> <span class="keyword">bool</span> <a name="idm46079577364160-bb"></a><span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">TimeT</span> <span class="keyword">const</span> <span class="special">&</span> t<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 81<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577361504-bb"></a><span class="identifier">unlock</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li> 82<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577360384-bb"></a><span class="identifier">lock_upgrade</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 83<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46079577359264-bb"></a><span class="identifier">try_lock_upgrade</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 84<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> TimeT<span class="special">></span> <span class="keyword">bool</span> <a name="idm46079577358144-bb"></a><span class="identifier">timed_lock_upgrade</span><span class="special">(</span><span class="identifier">TimeT</span> <span class="keyword">const</span> <span class="special">&</span> t<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 85<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577355488-bb"></a><span class="identifier">unlock_upgrade</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li> 86<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577354368-bb"></a><span class="identifier">unlock_upgrade_and_lock</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 87<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577353248-bb"></a><span class="identifier">unlock_and_lock_upgrade</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 88<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577352128-bb"></a><span class="identifier">unlock_and_lock_shared</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 89<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577351008-bb"></a><span class="identifier">unlock_upgrade_and_lock_shared</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 90<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm46079577349872-bb"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="multi_thread_model.html" title="Struct template multi_thread_model">multi_thread_model</a> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li> 91</ol></div> 92</div> 93</div> 94</div> 95<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 96<td align="left"></td> 97<td align="right"><div class="copyright-footer">Copyright © 2007-2019 Andrey Semashev<p> 98 Distributed under the Boost Software License, Version 1.0. (See accompanying 99 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>). 100 </p> 101</div></td> 102</tr></table> 103<hr> 104<div class="spirit-nav"> 105<a accesskey="p" href="wseverity_logger_mt.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../logging_sources.html#header.boost.log.sources.threading_models_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="single_thread_model.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 106</div> 107</body> 108</html> 109