blob: bc8d30c2ac0210ee3bb394accaf756d824f546ed (
plain) (
tree)
|
|
-module(no_2).
-compile(export_all).
?MODULE() ->
ok.
f1() ->
Ref = make_ref(),
receive
{'DOWN',Ref} ->
ok;
{'DOWN',_} ->
ok
end.
f2(Pid, Msg) ->
Ref = erlang:monitor(process, Pid),
Pid ! Msg,
receive
{ok,Ref,Reply} ->
{ok,Reply};
{error,Ref,Reply} ->
{error,Reply};
{error,A,B} ->
{error,A,B}
end.
|