mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
fix in task local storage
This commit is contained in:
parent
3c8bb7d5e8
commit
b32bf3ea3c
1 changed files with 3 additions and 2 deletions
|
|
@ -44,8 +44,9 @@ let get (type a) ((module K) : a key) : a =
|
||||||
|
|
||||||
let set (type a) ((module K) : a key) (v : a) : unit =
|
let set (type a) ((module K) : a key) (v : a) : unit =
|
||||||
let cur = get_cur_ () in
|
let cur = get_cur_ () in
|
||||||
if K.offset >= Array.length !cur then resize_ cur K.offset;
|
if K.offset >= Array.length !cur then resize_ cur (K.offset + 1);
|
||||||
!cur.(K.offset) <- K.V v
|
!cur.(K.offset) <- K.V v;
|
||||||
|
()
|
||||||
|
|
||||||
let with_value key x f =
|
let with_value key x f =
|
||||||
let old = get key in
|
let old = get key in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue