This commit is contained in:
manojsdoshi
2020-04-24 01:09:47 +00:00
parent 4ad595bf18
commit 430f6c0cf3
2864 changed files with 304301 additions and 292875 deletions

View File

@@ -107,52 +107,53 @@ $(function() {
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classripple_1_1basic__semaphore.html#a70b65a73bd62bd3b1e15f25297514494"> 37</a></span>&#160; <span class="keyword">using</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">size_type</a> = <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a>;</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classripple_1_1basic__semaphore.html#a881f36997b728fa7093cc0fed4150d8b"> 42</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="classripple_1_1basic__semaphore.html#a881f36997b728fa7093cc0fed4150d8b">basic_semaphore</a> (<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">size_type</a> count = 0)</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; : <a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a> (count)</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; {</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; }</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="classripple_1_1basic__semaphore.html#afb527f24d3a10d885892f8f46d8ce49c"> 48</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classripple_1_1basic__semaphore.html#afb527f24d3a10d885892f8f46d8ce49c">notify</a> ()</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classripple_1_1basic__semaphore.html#a881f36997b728fa7093cc0fed4150d8b"> 42</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="classripple_1_1basic__semaphore.html#a881f36997b728fa7093cc0fed4150d8b">basic_semaphore</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">size_type</a> count = 0) : <a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a>(count)</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; {</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; }</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordtype">void</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="classripple_1_1basic__semaphore.html#afb527f24d3a10d885892f8f46d8ce49c"> 48</a></span>&#160; <a class="code" href="classripple_1_1basic__semaphore.html#afb527f24d3a10d885892f8f46d8ce49c">notify</a>()</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; {</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/thread/lock_guard.html">std::lock_guard</a> lock{<a class="code" href="classripple_1_1basic__semaphore.html#a4cdfd0582d4673cb56de9d9de689aadc">m_mutex</a>};</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; ++<a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a>;</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <a class="code" href="classripple_1_1basic__semaphore.html#ae88049f63899f4ed72c788b4b1f989be">m_cond</a>.notify_one ();</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <a class="code" href="classripple_1_1basic__semaphore.html#ae88049f63899f4ed72c788b4b1f989be">m_cond</a>.notify_one();</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; }</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classripple_1_1basic__semaphore.html#a4f15dff9ed04010b49cef17aa46b683b"> 56</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classripple_1_1basic__semaphore.html#a4f15dff9ed04010b49cef17aa46b683b">wait</a> ()</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; {</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/thread/unique_lock.html">std::unique_lock</a> lock{<a class="code" href="classripple_1_1basic__semaphore.html#a4cdfd0582d4673cb56de9d9de689aadc">m_mutex</a>};</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordflow">while</span> (<a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a> == 0)</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <a class="code" href="classripple_1_1basic__semaphore.html#ae88049f63899f4ed72c788b4b1f989be">m_cond</a>.wait (lock);</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; --<a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a>;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; }</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; </div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classripple_1_1basic__semaphore.html#a8b281f8b0690027c7f5c8071e866a013"> 67</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classripple_1_1basic__semaphore.html#a8b281f8b0690027c7f5c8071e866a013">try_wait</a> ()</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; {</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/thread/lock_guard.html">std::lock_guard</a> lock{<a class="code" href="classripple_1_1basic__semaphore.html#a4cdfd0582d4673cb56de9d9de689aadc">m_mutex</a>};</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a> == 0)</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; --<a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a>;</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; }</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;};</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="namespaceripple.html#a4a5d6c7c86203893fb6acf4b0821c802"> 77</a></span>&#160;<span class="keyword">using</span> <a class="code" href="classripple_1_1basic__semaphore.html">semaphore</a> = <a class="code" href="classripple_1_1basic__semaphore.html">basic_semaphore &lt;std::mutex, std::condition_variable&gt;</a>;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keywordtype">void</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="classripple_1_1basic__semaphore.html#a4f15dff9ed04010b49cef17aa46b683b"> 57</a></span>&#160; <a class="code" href="classripple_1_1basic__semaphore.html#a4f15dff9ed04010b49cef17aa46b683b">wait</a>()</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; {</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/thread/unique_lock.html">std::unique_lock</a> lock{<a class="code" href="classripple_1_1basic__semaphore.html#a4cdfd0582d4673cb56de9d9de689aadc">m_mutex</a>};</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">while</span> (<a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a> == 0)</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <a class="code" href="classripple_1_1basic__semaphore.html#ae88049f63899f4ed72c788b4b1f989be">m_cond</a>.wait(lock);</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; --<a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a>;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; }</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordtype">bool</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="classripple_1_1basic__semaphore.html#a8b281f8b0690027c7f5c8071e866a013"> 69</a></span>&#160; <a class="code" href="classripple_1_1basic__semaphore.html#a8b281f8b0690027c7f5c8071e866a013">try_wait</a>()</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; {</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/thread/lock_guard.html">std::lock_guard</a> lock{<a class="code" href="classripple_1_1basic__semaphore.html#a4cdfd0582d4673cb56de9d9de689aadc">m_mutex</a>};</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a> == 0)</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; --<a class="code" href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">m_count</a>;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; }</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;};</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;} <span class="comment">// ripple</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="namespaceripple.html#a3d1073988f9cea389d752de1ffb8803d"> 79</a></span>&#160;<span class="keyword">using</span> <a class="code" href="classripple_1_1basic__semaphore.html">semaphore</a> = <a class="code" href="classripple_1_1basic__semaphore.html">basic_semaphore&lt;std::mutex, std::condition_variable&gt;</a>;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;} <span class="comment">// namespace ripple</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="alock_guard_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/thread/lock_guard.html">std::lock_guard</a></div><div class="ttdoc">STL class.</div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html_a4cdfd0582d4673cb56de9d9de689aadc"><div class="ttname"><a href="classripple_1_1basic__semaphore.html#a4cdfd0582d4673cb56de9d9de689aadc">ripple::basic_semaphore::m_mutex</a></div><div class="ttdeci">Mutex m_mutex</div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00032">semaphore.h:32</a></div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html_ae88049f63899f4ed72c788b4b1f989be"><div class="ttname"><a href="classripple_1_1basic__semaphore.html#ae88049f63899f4ed72c788b4b1f989be">ripple::basic_semaphore::m_cond</a></div><div class="ttdeci">CondVar m_cond</div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00033">semaphore.h:33</a></div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html"><div class="ttname"><a href="classripple_1_1basic__semaphore.html">ripple::basic_semaphore</a></div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00029">semaphore.h:29</a></div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html_a4f15dff9ed04010b49cef17aa46b683b"><div class="ttname"><a href="classripple_1_1basic__semaphore.html#a4f15dff9ed04010b49cef17aa46b683b">ripple::basic_semaphore::wait</a></div><div class="ttdeci">void wait()</div><div class="ttdoc">Block until notify is called.</div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00056">semaphore.h:56</a></div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html_a4f15dff9ed04010b49cef17aa46b683b"><div class="ttname"><a href="classripple_1_1basic__semaphore.html#a4f15dff9ed04010b49cef17aa46b683b">ripple::basic_semaphore::wait</a></div><div class="ttdeci">void wait()</div><div class="ttdoc">Block until notify is called.</div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00057">semaphore.h:57</a></div></div>
<div class="ttc" id="aunique_lock_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/thread/unique_lock.html">std::unique_lock</a></div><div class="ttdoc">STL class.</div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html_a881f36997b728fa7093cc0fed4150d8b"><div class="ttname"><a href="classripple_1_1basic__semaphore.html#a881f36997b728fa7093cc0fed4150d8b">ripple::basic_semaphore::basic_semaphore</a></div><div class="ttdeci">basic_semaphore(size_type count=0)</div><div class="ttdoc">Create the semaphore, with an optional initial count.</div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00042">semaphore.h:42</a></div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html_afb527f24d3a10d885892f8f46d8ce49c"><div class="ttname"><a href="classripple_1_1basic__semaphore.html#afb527f24d3a10d885892f8f46d8ce49c">ripple::basic_semaphore::notify</a></div><div class="ttdeci">void notify()</div><div class="ttdoc">Increment the count and unblock one waiting thread.</div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00048">semaphore.h:48</a></div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html_a8b281f8b0690027c7f5c8071e866a013"><div class="ttname"><a href="classripple_1_1basic__semaphore.html#a8b281f8b0690027c7f5c8071e866a013">ripple::basic_semaphore::try_wait</a></div><div class="ttdeci">bool try_wait()</div><div class="ttdoc">Perform a non-blocking wait.</div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00067">semaphore.h:67</a></div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html_a8b281f8b0690027c7f5c8071e866a013"><div class="ttname"><a href="classripple_1_1basic__semaphore.html#a8b281f8b0690027c7f5c8071e866a013">ripple::basic_semaphore::try_wait</a></div><div class="ttdeci">bool try_wait()</div><div class="ttdoc">Perform a non-blocking wait.</div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00069">semaphore.h:69</a></div></div>
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition:</b> <a href="RCLCensorshipDetector_8h_source.html#l00029">RCLCensorshipDetector.h:29</a></div></div>
<div class="ttc" id="aclassripple_1_1basic__semaphore_html_a4e32a2af04d2aadf63f616543049f999"><div class="ttname"><a href="classripple_1_1basic__semaphore.html#a4e32a2af04d2aadf63f616543049f999">ripple::basic_semaphore::m_count</a></div><div class="ttdeci">std::size_t m_count</div><div class="ttdef"><b>Definition:</b> <a href="semaphore_8h_source.html#l00034">semaphore.h:34</a></div></div>
<div class="ttc" id="acondition_variable_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/condition_variable.html">condition_variable</a></div></div>