File tree Expand file tree Collapse file tree 6 files changed +24
-34
lines changed Expand file tree Collapse file tree 6 files changed +24
-34
lines changed Original file line number Diff line number Diff line change 7
7
(select
8
8
picos.ml
9
9
from
10
- (picos_private_ocaml4 -> picos.ocaml4 .ml)
11
- (picos_private_ocaml5 -> picos.ocaml5 .ml))
10
+ (picos_private_ocaml4 -> picos.common .ml)
11
+ (picos_private_ocaml5 -> picos.common .ml))
12
12
(select
13
13
intf.ml
14
14
from
Original file line number Diff line number Diff line change 28
28
module Computation = struct
29
29
include Picos_private_bootstrap. Computation
30
30
31
- let rec await t =
32
- match Atomic. get t with
33
- | Returned value -> value
34
- | Canceled exn_bt -> Exn_bt. raise exn_bt
35
- | Continue _ ->
36
- let trigger = Trigger. create () in
37
- if try_attach t trigger then begin
38
- match Trigger. await trigger with
39
- | None -> await t
40
- | Some exn_bt ->
41
- detach t trigger;
42
- Exn_bt. raise exn_bt
43
- end
44
- else await t
45
-
46
31
let cancel_after computation ~seconds exn_bt =
47
32
if 0.0 < = seconds then
48
33
let _ = Fiber. current () in
Original file line number Diff line number Diff line change 52
52
module Computation = struct
53
53
include Picos_private_bootstrap. Computation
54
54
55
- let rec await t =
56
- match Atomic. get t with
57
- | Returned value -> value
58
- | Canceled exn_bt -> Exn_bt. raise exn_bt
59
- | Continue _ ->
60
- let trigger = Picos_private_bootstrap.Trigger. create () in
61
- if try_attach t trigger then begin
62
- match Trigger. await trigger with
63
- | None -> await t
64
- | Some exn_bt ->
65
- detach t trigger;
66
- Exn_bt. raise exn_bt
67
- end
68
- else await t
69
-
70
55
type _ Effect.t + =
71
56
| Cancel_after : {
72
57
seconds : float ;
Original file line number Diff line number Diff line change
1
+ include Picos_private
2
+
3
+ module Computation = struct
4
+ include Computation
5
+
6
+ let block t =
7
+ let trigger = Trigger. create () in
8
+ if try_attach t trigger then begin
9
+ match Trigger. await trigger with
10
+ | None -> t
11
+ | Some exn_bt ->
12
+ detach t trigger;
13
+ Exn_bt. raise exn_bt
14
+ end
15
+ else t
16
+
17
+ let rec await t =
18
+ match Atomic. get t with
19
+ | Returned value -> value
20
+ | Canceled exn_bt -> Exn_bt. raise exn_bt
21
+ | Continue _ -> await (block t)
22
+ end
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments