fix compilation on < 5.xx

This commit is contained in:
Simon Cruanes 2024-04-23 11:32:29 -04:00
parent 7ed2e6991c
commit 0d7f348aa9
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -23,6 +23,8 @@ let try_lock_ (self : 'a t) : 'a option =
else
None
[@@@ifge 5.0]
let rec lock_ (self : 'a t) : 'a =
let old = A.get self.st in
if old.locked then (
@ -104,3 +106,5 @@ let with_try_lock self f =
let bt = Printexc.get_raw_backtrace () in
unlock_ self x;
Printexc.raise_with_backtrace e bt)
[@@@endif]