mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
fix compilation on < 5.xx
This commit is contained in:
parent
7ed2e6991c
commit
0d7f348aa9
1 changed files with 4 additions and 0 deletions
|
|
@ -23,6 +23,8 @@ let try_lock_ (self : 'a t) : 'a option =
|
||||||
else
|
else
|
||||||
None
|
None
|
||||||
|
|
||||||
|
[@@@ifge 5.0]
|
||||||
|
|
||||||
let rec lock_ (self : 'a t) : 'a =
|
let rec lock_ (self : 'a t) : 'a =
|
||||||
let old = A.get self.st in
|
let old = A.get self.st in
|
||||||
if old.locked then (
|
if old.locked then (
|
||||||
|
|
@ -104,3 +106,5 @@ let with_try_lock self f =
|
||||||
let bt = Printexc.get_raw_backtrace () in
|
let bt = Printexc.get_raw_backtrace () in
|
||||||
unlock_ self x;
|
unlock_ self x;
|
||||||
Printexc.raise_with_backtrace e bt)
|
Printexc.raise_with_backtrace e bt)
|
||||||
|
|
||||||
|
[@@@endif]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue