Skip to content

Commit

Permalink
Don't exit while a domain is still running
Browse files Browse the repository at this point in the history
This causes crashes in cleanup-at-exit mode (c=1) and could be a
problem under Windows too.
  • Loading branch information
xavierleroy committed Jan 19, 2022
1 parent f469fc5 commit 78fd956
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions testsuite/tests/parallel/poll.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ include unix
** native
*)

let continue = Atomic.make true

let rec loop () =
loop ()
if Atomic.get continue then loop ()

let _ =
ignore (Domain.spawn loop);
let d = Domain.spawn loop in
Unix.sleepf 0.1;
Gc.full_major();
Atomic.set continue false;
Domain.join d;
print_endline "OK"

0 comments on commit 78fd956

Please sign in to comment.