Picos_thread.TLS
Thread-local storage.
Note that here "thread" refers to system level threads rather than fibers or domains. In case a system level thread implementation, i.e. the threads.posix
library, is not available, this will use Picos_domain.DLS
.
val create : unit -> 'a t
create ()
allocates a new key for associating values with threads.
⚠️ Keys should not be created dynamically as each key will potentially increase the space taken by every thread.
Exception raised by get_exn
when no value is associated with the specified key for the current thread.
val get_exn : 'a t -> 'a
val set : 'a t -> 'a -> unit
set key value
associates the value with the specified key for the current thread.