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) @ once portable) @ portable ->
(unit -> 'a) @ portable ->
'a key @@ portableLike DLS.new_key, but represents a distinct value in every thread.
val get : ('a : value mod portable). 'a key -> 'a @ contended @@ portableLike DLS.get, but reads the value for the current thread.
val set :
('a : value mod contended). 'a key ->
'a @ portable ->
unit @@ portableLike DLS.set, but sets the value for the current thread.