Welcome to mirror list, hosted at ThFree Co, Russian Federation.

classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html - github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4f2f65dd6084d69c2b732c5e65ddf61a4221733a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!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>LLFIO: llfio_v2_xxx::algorithm::shared_fs_mutex::lock_files 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">
  $(document).ready(initResizable);
</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" />
</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">LLFIO
   &#160;<span id="projectnumber">v2.00 late alpha</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</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');
  $(document).ready(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">
$(document).ready(function(){initNavTree('classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html','');});
</script>
<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">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">llfio_v2_xxx::algorithm::shared_fs_mutex::lock_files Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Many entity exclusive compatibility file system based lock.  
 <a href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#details">More...</a></p>

<p><code>#include &quot;lock_files.hpp&quot;</code></p>
<div class="dynheader">
Inheritance diagram for llfio_v2_xxx::algorithm::shared_fs_mutex::lock_files:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.png" usemap="#llfio_5Fv2_5Fxxx::algorithm::shared_5Ffs_5Fmutex::lock_5Ffiles_map" alt=""/>
  <map id="llfio_5Fv2_5Fxxx::algorithm::shared_5Ffs_5Fmutex::lock_5Ffiles_map" name="llfio_5Fv2_5Fxxx::algorithm::shared_5Ffs_5Fmutex::lock_5Ffiles_map">
<area href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html" title="Abstract base class for an object which protects shared filing system resources. " alt="llfio_v2_xxx::algorithm::shared_fs_mutex::shared_fs_mutex" shape="rect" coords="0,0,337,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a3d30413d592be2c4802f50b9cf891681"><td class="memItemLeft" align="right" valign="top"><a id="a3d30413d592be2c4802f50b9cf891681"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a3d30413d592be2c4802f50b9cf891681">entity_type</a> = <a class="el" href="structllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entity__type.html">shared_fs_mutex::entity_type</a></td></tr>
<tr class="memdesc:a3d30413d592be2c4802f50b9cf891681"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of an entity id. <br /></td></tr>
<tr class="separator:a3d30413d592be2c4802f50b9cf891681"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34ce9a41ae0dbb92f1b08b36aab8dcf5"><td class="memItemLeft" align="right" valign="top"><a id="a34ce9a41ae0dbb92f1b08b36aab8dcf5"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a34ce9a41ae0dbb92f1b08b36aab8dcf5">entities_type</a> = <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#aec91125605e5a8379b7616b7f90d1232">shared_fs_mutex::entities_type</a></td></tr>
<tr class="memdesc:a34ce9a41ae0dbb92f1b08b36aab8dcf5"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of a sequence of entities. <br /></td></tr>
<tr class="separator:a34ce9a41ae0dbb92f1b08b36aab8dcf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><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:af3593bcad8dcb03a5c037af008203994"><td class="memItemLeft" align="right" valign="top"><a id="af3593bcad8dcb03a5c037af008203994"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#af3593bcad8dcb03a5c037af008203994">lock_files</a> (const <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html">lock_files</a> &amp;)=delete</td></tr>
<tr class="memdesc:af3593bcad8dcb03a5c037af008203994"><td class="mdescLeft">&#160;</td><td class="mdescRight">No copy construction. <br /></td></tr>
<tr class="separator:af3593bcad8dcb03a5c037af008203994"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8935d7f9ebfb12b39340c7badd18186"><td class="memItemLeft" align="right" valign="top"><a id="ae8935d7f9ebfb12b39340c7badd18186"></a>
<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html">lock_files</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#ae8935d7f9ebfb12b39340c7badd18186">operator=</a> (const <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html">lock_files</a> &amp;)=delete</td></tr>
<tr class="memdesc:ae8935d7f9ebfb12b39340c7badd18186"><td class="mdescLeft">&#160;</td><td class="mdescRight">No copy assignment. <br /></td></tr>
<tr class="separator:ae8935d7f9ebfb12b39340c7badd18186"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcb24c8ebc1df2bab720be28e889a485"><td class="memItemLeft" align="right" valign="top"><a id="abcb24c8ebc1df2bab720be28e889a485"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#abcb24c8ebc1df2bab720be28e889a485">lock_files</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html">lock_files</a> &amp;&amp;o) noexcept</td></tr>
<tr class="memdesc:abcb24c8ebc1df2bab720be28e889a485"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move constructor. <br /></td></tr>
<tr class="separator:abcb24c8ebc1df2bab720be28e889a485"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38aaf831bd6914abf71b6eb58a2fe06b"><td class="memItemLeft" align="right" valign="top"><a id="a38aaf831bd6914abf71b6eb58a2fe06b"></a>
<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html">lock_files</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a38aaf831bd6914abf71b6eb58a2fe06b">operator=</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html">lock_files</a> &amp;&amp;o) noexcept</td></tr>
<tr class="memdesc:a38aaf831bd6914abf71b6eb58a2fe06b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move assign. <br /></td></tr>
<tr class="separator:a38aaf831bd6914abf71b6eb58a2fe06b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae5fb3b8a373a61c6cdad578281843395"><td class="memItemLeft" align="right" valign="top"><a id="ae5fb3b8a373a61c6cdad578281843395"></a>
const <a class="el" href="classllfio__v2__xxx_1_1path__handle.html">path_handle</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#ae5fb3b8a373a61c6cdad578281843395">path</a> () const noexcept</td></tr>
<tr class="memdesc:ae5fb3b8a373a61c6cdad578281843395"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the path to the directory being used for this lock. <br /></td></tr>
<tr class="separator:ae5fb3b8a373a61c6cdad578281843395"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e898ef170b38add24229c6ed9b91b74"><td class="memItemLeft" align="right" valign="top"><a id="a9e898ef170b38add24229c6ed9b91b74"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a9e898ef170b38add24229c6ed9b91b74">unlock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#aec91125605e5a8379b7616b7f90d1232">entities_type</a>, unsigned long long) noexcept final</td></tr>
<tr class="memdesc:a9e898ef170b38add24229c6ed9b91b74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unlock a previously locked sequence of entities. <br /></td></tr>
<tr class="separator:a9e898ef170b38add24229c6ed9b91b74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cdf15b69bf6f375ec7083d639f76358"><td class="memItemLeft" align="right" valign="top"><a id="a4cdf15b69bf6f375ec7083d639f76358"></a>
<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a3d30413d592be2c4802f50b9cf891681">entity_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a4cdf15b69bf6f375ec7083d639f76358">entity_from_buffer</a> (const char *buffer, size_t bytes, bool exclusive=true) noexcept</td></tr>
<tr class="memdesc:a4cdf15b69bf6f375ec7083d639f76358"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates an entity id from a sequence of bytes. <br /></td></tr>
<tr class="separator:a4cdf15b69bf6f375ec7083d639f76358"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb28aedaf5caa53e851165a4f1927207"><td class="memTemplParams" colspan="2"><a id="afb28aedaf5caa53e851165a4f1927207"></a>
template&lt;typename T &gt; </td></tr>
<tr class="memitem:afb28aedaf5caa53e851165a4f1927207"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a3d30413d592be2c4802f50b9cf891681">entity_type</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#afb28aedaf5caa53e851165a4f1927207">entity_from_string</a> (const std::basic_string&lt; T &gt; &amp;str, bool exclusive=true) noexcept</td></tr>
<tr class="memdesc:afb28aedaf5caa53e851165a4f1927207"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates an entity id from a string. <br /></td></tr>
<tr class="separator:afb28aedaf5caa53e851165a4f1927207"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d62fe0c18bcfb1ade9ff9c7bb00e70b"><td class="memItemLeft" align="right" valign="top"><a id="a8d62fe0c18bcfb1ade9ff9c7bb00e70b"></a>
<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a3d30413d592be2c4802f50b9cf891681">entity_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a8d62fe0c18bcfb1ade9ff9c7bb00e70b">random_entity</a> (bool exclusive=true) noexcept</td></tr>
<tr class="memdesc:a8d62fe0c18bcfb1ade9ff9c7bb00e70b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a cryptographically random entity id. <br /></td></tr>
<tr class="separator:a8d62fe0c18bcfb1ade9ff9c7bb00e70b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab33ccb32052633a55cb3bb5d1bbdf52b"><td class="memItemLeft" align="right" valign="top"><a id="ab33ccb32052633a55cb3bb5d1bbdf52b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#ab33ccb32052633a55cb3bb5d1bbdf52b">fill_random_entities</a> (span&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a3d30413d592be2c4802f50b9cf891681">entity_type</a> &gt; seq, bool exclusive=true) noexcept</td></tr>
<tr class="memdesc:ab33ccb32052633a55cb3bb5d1bbdf52b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a sequence of entity ids with cryptographic randomness. Much faster than calling random_entity() individually. <br /></td></tr>
<tr class="separator:ab33ccb32052633a55cb3bb5d1bbdf52b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc6284803080e42505ba812d4711bb74"><td class="memItemLeft" align="right" valign="top"><a id="adc6284803080e42505ba812d4711bb74"></a>
result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#adc6284803080e42505ba812d4711bb74">lock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#aec91125605e5a8379b7616b7f90d1232">entities_type</a> entities, <a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a> d=<a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a>(), bool spin_not_sleep=false) noexcept</td></tr>
<tr class="memdesc:adc6284803080e42505ba812d4711bb74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lock all of a sequence of entities for exclusive or shared access. <br /></td></tr>
<tr class="separator:adc6284803080e42505ba812d4711bb74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33dcc1d37df90ac5dd85a754f9ffce04"><td class="memItemLeft" align="right" valign="top"><a id="a33dcc1d37df90ac5dd85a754f9ffce04"></a>
result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a33dcc1d37df90ac5dd85a754f9ffce04">lock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a3d30413d592be2c4802f50b9cf891681">entity_type</a> entity, <a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a> d=<a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a>(), bool spin_not_sleep=false) noexcept</td></tr>
<tr class="memdesc:a33dcc1d37df90ac5dd85a754f9ffce04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lock a single entity for exclusive or shared access. <br /></td></tr>
<tr class="separator:a33dcc1d37df90ac5dd85a754f9ffce04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a051822a4942c7f45b0491ab4385aacd3"><td class="memItemLeft" align="right" valign="top"><a id="a051822a4942c7f45b0491ab4385aacd3"></a>
result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a051822a4942c7f45b0491ab4385aacd3">try_lock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#aec91125605e5a8379b7616b7f90d1232">entities_type</a> entities) noexcept</td></tr>
<tr class="memdesc:a051822a4942c7f45b0491ab4385aacd3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to lock all of a sequence of entities for exclusive or shared access. <br /></td></tr>
<tr class="separator:a051822a4942c7f45b0491ab4385aacd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a7f463e9235bb95ddd84b69e2642613"><td class="memItemLeft" align="right" valign="top"><a id="a5a7f463e9235bb95ddd84b69e2642613"></a>
result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex.html#a5a7f463e9235bb95ddd84b69e2642613">try_lock</a> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a3d30413d592be2c4802f50b9cf891681">entity_type</a> entity) noexcept</td></tr>
<tr class="memdesc:a5a7f463e9235bb95ddd84b69e2642613"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to lock a single entity for exclusive or shared access. <br /></td></tr>
<tr class="separator:a5a7f463e9235bb95ddd84b69e2642613"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a1c81828f9f391f848a57cf8046395ef3"><td class="memItemLeft" align="right" valign="top"><a id="a1c81828f9f391f848a57cf8046395ef3"></a>
static result&lt; <a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html">lock_files</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html#a1c81828f9f391f848a57cf8046395ef3">fs_mutex_lock_files</a> (const <a class="el" href="classllfio__v2__xxx_1_1path__handle.html">path_handle</a> &amp;lockdir) noexcept</td></tr>
<tr class="memdesc:a1c81828f9f391f848a57cf8046395ef3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialises a shared filing system mutex using the directory at <em>lockdir</em> which MUST stay valid for the duration of this lock. <br /></td></tr>
<tr class="separator:a1c81828f9f391f848a57cf8046395ef3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a5de42e3023b15ea85b13bfdce1753dd2"><td class="memItemLeft" align="right" valign="top"><a id="a5de42e3023b15ea85b13bfdce1753dd2"></a>
virtual result&lt; void &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>_lock</b> (<a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1shared__fs__mutex_1_1entities__guard.html">entities_guard</a> &amp;out, <a class="el" href="structllfio__v2__xxx_1_1deadline.html">deadline</a> d, bool spin_not_sleep) noexcept final</td></tr>
<tr class="separator:a5de42e3023b15ea85b13bfdce1753dd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Many entity exclusive compatibility file system based lock. </p>
<p>This is a very simple many entity shared mutex likely to work almost anywhere without surprises. It works by trying to exclusively create a file called the hex of the entity id. If it fails to exclusively create any file, it deletes all previously created files, randomises the order and tries locking them again until success. The only real reason to use this implementation is its excellent compatibility with almost everything, most users will want byte_ranges instead.</p>
<ul>
<li>Compatible with all networked file systems.</li>
<li>Linear complexity to number of concurrent users.</li>
<li>Exponential complexity to number of contended entities being concurrently locked.</li>
<li>Requests for shared locks are treated as if for exclusive locks.</li>
</ul>
<p>Caveats:</p><ul>
<li>No ability to sleep until a lock becomes free, so CPUs are spun at 100%.</li>
<li>On POSIX only sudden process exit with locks held will deadlock all other users by leaving stale files around.</li>
<li>Costs a file descriptor per entity locked.</li>
<li>Sudden power loss during use will deadlock first user after reboot, again due to stale files.</li>
<li>Currently this implementation does not permit more than one lock() per instance as the lock information is stored as member data. Creating multiple instances referring to the same path works fine. This could be fixed easily, but it would require a memory allocation per lock and user demand that this is actually a problem in practice.</li>
<li>Leaves many 16 character long hexadecimal named files in the supplied directory which may confuse users. Tip: create a hidden lockfile directory.</li>
</ul>
<p>Fixing the stale lock file problem could be quite trivial - simply byte range lock the first byte in the lock file to detect when a lock file is stale. However in this situation using the byte_ranges algorithm would be far superior, so implementing stale lock file clean up is left up to the user. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>include/llfio/v2.0/algorithm/shared_fs_mutex/<a class="el" href="lock__files_8hpp.html">lock_files.hpp</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="namespacellfio__v2__xxx.html">llfio_v2_xxx</a></li><li class="navelem"><a class="el" href="namespacellfio__v2__xxx_1_1algorithm.html">algorithm</a></li><li class="navelem"><a class="el" href="namespacellfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex.html">shared_fs_mutex</a></li><li class="navelem"><a class="el" href="classllfio__v2__xxx_1_1algorithm_1_1shared__fs__mutex_1_1lock__files.html">lock_files</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.13 </li>
  </ul>
</div>
</body>
</html>