mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-10 05:03:58 -05:00
2 lines
3.3 KiB
HTML
2 lines
3.3 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Condition (picos_std.Picos_std_sync.Condition)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../../index.html">Index</a> » <a href="../../index.html">picos_std</a> » <a href="../index.html">Picos_std_sync</a> » Condition</nav><header class="odoc-preamble"><h1>Module <code><span>Picos_std_sync.Condition</span></code></h1><p>A condition variable.</p><p>ℹ️ This intentionally mimics the interface of <a href="../../../ocaml/Stdlib/Condition/index.html"><code>Stdlib.Condition</code></a>. Unlike with the standard library condition variable, blocking on this condition variable allows an effects based scheduler to run other fibers on the thread.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p>Represents a condition variable.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span><span class="optlabel">?padded</span>:bool <span class="arrow">-></span></span> <span>unit <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>create ()</code> return a new condition variable.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-wait"><a href="#val-wait" class="anchor"></a><code><span><span class="keyword">val</span> wait : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><a href="../Mutex/index.html#type-t">Mutex.t</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>wait condition</code> unlocks the <code>mutex</code>, waits for the <code>condition</code>, and locks the <code>mutex</code> before returning or raising due to the operation being canceled.</p><p>ℹ️ If the fiber has been canceled and propagation of cancelation is allowed, this may raise the cancelation exception.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-signal"><a href="#val-signal" class="anchor"></a><code><span><span class="keyword">val</span> signal : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>signal condition</code> wakes up one fiber waiting on the <code>condition</code> variable unless there are no such fibers.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-broadcast"><a href="#val-broadcast" class="anchor"></a><code><span><span class="keyword">val</span> broadcast : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>broadcast condition</code> wakes up all the fibers waiting on the <code>condition</code> variable.</p></div></div></div></body></html>
|