File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ let test_mutex_and_condition_cancelation () =
127
127
let some_false = Some false in
128
128
129
129
let deadline = Unix. gettimeofday () +. 60.0 in
130
+ let hard_deadline = Unix. gettimeofday () +. 120.0 in
130
131
131
132
let main i () =
132
133
Fun. protect ~finally: (fun () -> Atomic. decr exit) @@ fun () ->
@@ -145,7 +146,8 @@ let test_mutex_and_condition_cancelation () =
145
146
Domain. spawn (fun () ->
146
147
let state = Random.State. make_self_init () in
147
148
while Atomic. get exit <> 0 do
148
- Domain. cpu_relax () ;
149
+ if hard_deadline < Unix. gettimeofday () then Stdlib. exit 4
150
+ else Domain. cpu_relax () ;
149
151
let (Packed computation) =
150
152
computations.(Random.State. bits state land (n - 1 ))
151
153
in
@@ -155,7 +157,8 @@ let test_mutex_and_condition_cancelation () =
155
157
in
156
158
let state = Random.State. make_self_init () in
157
159
while Atomic. get exit <> 0 do
158
- Domain. cpu_relax () ;
160
+ if hard_deadline < Unix. gettimeofday () then Stdlib. exit 3
161
+ else Domain. cpu_relax () ;
159
162
if Random.State. bool state then Condition. broadcast condition
160
163
else Condition. signal condition
161
164
done ;
You can’t perform that action at this time.
0 commit comments