jon.recoil.org

Module Domain.TLSSource

Thread-local storage. Like DLS, but stores a distinct value for each thread. Domains can contain multiple threads, so TLS should be preferred in nearly all cases.

Sourcetype 'a key

Type of a TLS key

Sourceval new_key : ?split_from_parent:('a -> 'a) -> (unit -> 'a) -> 'a Stdlib.Domain.TLS.key

Like DLS.new_key, but represents a distinct value in every thread.

  • alert unsafe_multidomain Use [Domain.Safe.TLS.new_key].
Sourceval get : 'a Stdlib.Domain.TLS.key -> 'a

Like DLS.get, but reads the value for the current thread.

  • alert unsafe_multidomain Use [Domain.Safe.TLS.get].
Sourceval set : 'a Stdlib.Domain.TLS.key -> 'a -> unit

Like DLS.set, but sets the value for the current thread.

  • alert unsafe_multidomain Use [Domain.Safe.TLS.set].
Sourcemodule Private : sig ... end

For use by the threading library.