mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
2 lines
No EOL
2.5 KiB
HTML
2 lines
No EOL
2.5 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Barrier (containers.CCThread.Barrier)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">containers</a> » <a href="../index.html">CCThread</a> » Barrier</nav><h1>Module <code>CCThread.Barrier</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code></dt><dd><p>Barrier, used to synchronize threads</p></dd></dl><dl><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val</span> create : unit <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Create a barrier.</p></dd></dl><dl><dt class="spec value" id="val-reset"><a href="#val-reset" class="anchor"></a><code><span class="keyword">val</span> reset : <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p>Reset to initial (non-triggered) state.</p></dd></dl><dl><dt class="spec value" id="val-wait"><a href="#val-wait" class="anchor"></a><code><span class="keyword">val</span> wait : <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p><code>wait b</code> waits for barrier <code>b</code> to be activated by <code>activate b</code>. All threads calling this wait until <code>activate b</code> is called. If <code>b</code> is already activated, <code>wait b</code> does nothing.</p></dd></dl><dl><dt class="spec value" id="val-activate"><a href="#val-activate" class="anchor"></a><code><span class="keyword">val</span> activate : <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p><code>activate b</code> unblocks all threads that were waiting on <code>b</code>.</p></dd></dl><dl><dt class="spec value" id="val-activated"><a href="#val-activated" class="anchor"></a><code><span class="keyword">val</span> activated : <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dd><p><code>activated b</code> returns <code>true</code> iff <code>activate b</code> was called, and <code>reset b</code> was not called since. In other words, <code>activated b = true</code> means <code>wait b</code> will not block.</p></dd></dl></div></body></html> |