Skip to content
Permalink
Browse files
Fixing trace disconnection race condition
  • Loading branch information
ferd committed Jun 26, 2015
1 parent f6875ff commit a567348c4bce6268fa1f945a6325a08d7e656661
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
@@ -31,6 +31,7 @@ all stable changes of the first version of Recon.
- Doc made clearer around semantics of `recon:proc_count` and
`recon:proc_window`.
- Fix doc typos
- Fix potential race condition on waiting for death of tracing process
- 2.2.1
- Fixing type specs for `recon:port_types/0` and `recon_lib:count/1`,
thanks to @lucafavatella
@@ -550,14 +550,14 @@ maybe_kill(Name) ->
Pid ->
unlink(Pid),
exit(Pid, kill),
wait_for_death(Pid)
wait_for_death(Pid, Name)
end.

wait_for_death(Pid) ->
case is_process_alive(Pid) of
wait_for_death(Pid, Name) ->
case is_process_alive(Pid) orelse whereis(Name) =:= Pid of
true ->
timer:sleep(10),
wait_for_death(Pid);
wait_for_death(Pid, Name);
false ->
ok
end.

0 comments on commit a567348

Please sign in to comment.