mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-07 18:37:56 -05:00
2 lines
2.1 KiB
HTML
2 lines
2.1 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Lock (opentelemetry.Opentelemetry.Lock)</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">opentelemetry</a> » <a href="../index.html">Opentelemetry</a> » Lock</nav><header class="odoc-preamble"><h1>Module <code><span>Opentelemetry.Lock</span></code></h1><p>Global lock.</p><p>A global lock, modifiable by the user</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-set_mutex"><a href="#val-set_mutex" class="anchor"></a><code><span><span class="keyword">val</span> set_mutex : <span><span class="label">lock</span>:<span>(<span>unit <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span> <span><span class="label">unlock</span>:<span>(<span>unit <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Set a pair of lock/unlock functions that are used to protect access to global state, if needed. By default these do nothing.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_lock"><a href="#val-with_lock" class="anchor"></a><code><span><span class="keyword">val</span> with_lock : <span><span>(<span>unit <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p>Call <code>f()</code> while holding the mutex defined <a href="#val-set_mutex"><code>set_mutex</code></a>, then release the mutex.</p></div></div></div></body></html>
|