ocaml-opentelemetry/opentelemetry/Opentelemetry/Lock/index.html
2025-11-19 17:23:41 +00:00

2 lines
2.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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> &#x00BB; <a href="../../index.html">opentelemetry</a> &#x00BB; <a href="../index.html">Opentelemetry</a> &#x00BB; 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">&#45;&gt;</span></span> unit)</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="label">unlock</span>:<span>(<span>unit <span class="arrow">&#45;&gt;</span></span> unit)</span> <span class="arrow">&#45;&gt;</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">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</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>