summaryrefslogtreecommitdiff
path: root/lib/stdlib/test/shell_docs_SUITE_data/unknown_erlang_is_process_alive_1_func.txt
blob: e8a9970a4d32484b7a1655f11cc1bed261c76ce4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

  -spec is_process_alive(Pid) -> boolean() when Pid :: pid().

  Pid must refer to a process at the local node.

  Returns true if the process exists and is alive, that is, is not
  exiting and has not exited. Otherwise returns false.

  If process P1 calls is_process_alive(P2Pid) it is guaranteed
  that all signals, sent from P1 to P2 (P2 is the process with
  identifier P2Pid) before the call, will be delivered to P2
  before the aliveness of P2 is checked. This guarantee means that
  one can use is_process_alive/1 to let a process P1 wait until
  a process P2, which has got an exit signal with reason kill
  from P1, is killed. Example:

    exit(P2Pid, kill),
    % P2 might not be killed
    is_process_alive(P2Pid),
    % P2 is not alive (the call above always return false)

  See the documentation about signals and erlang:exit/2 for more
  information about signals and exit signals.