Module Thread.TLS
Thread-local storage. Like Domain.DLS, but stores a distinct value for each thread. Domains can contain multiple threads, so TLS should be preferred in nearly all cases.
val new_key :
?split_from_parent:('a -> unit -> 'a) @ portable ->
(unit -> 'a) @ portable ->
'a Thread.TLS.key @@ portableLike DLS.new_key, but represents a distinct value in every thread.
val get : 'a. 'a Thread.TLS.key -> 'a @ contended @@ portableLike DLS.get, but reads the value for the current thread.
val set : 'a. 'a Thread.TLS.key -> 'a @ portable -> unit @@ portableLike DLS.set, but sets the value for the current thread.