add Task_local_storage.remove_in_local_hmap

This commit is contained in:
Simon Cruanes 2024-08-30 09:46:49 -04:00
parent 7df8c069ed
commit 0545a39aff
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -31,6 +31,10 @@ let get_in_local_hmap_opt (k : 'a Hmap.key) : 'a option =
let h = get_local_hmap () in
Hmap.find k h
(** Remove given key from the local hmap *)
let[@inline] remove_in_local_hmap (k : _ Hmap.key) : unit =
update_local_hmap (Hmap.rem k)
let[@inline] set_in_local_hmap (k : 'a Hmap.key) (v : 'a) : unit =
update_local_hmap (Hmap.add k v)