aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_service.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2015-01-19 11:45:40 +0100
committerAnders Svensson <[email protected]>2015-01-19 14:18:43 +0100
commit65153795869eda29ccd1bb0d3b5c14e390681f4f (patch)
treeb023cec3aaeadd1fbf67bd1efc6b16d2b7a6d3f3 /lib/diameter/src/base/diameter_service.erl
parentaf87b1c3d4897840d8247589a88d3611106ecedc (diff)
downloadotp-65153795869eda29ccd1bb0d3b5c14e390681f4f.tar.gz
otp-65153795869eda29ccd1bb0d3b5c14e390681f4f.tar.bz2
otp-65153795869eda29ccd1bb0d3b5c14e390681f4f.zip
Monitor more efficiently at shutdown
There's no need for building a pid list only to map it to a list of monitor references. Also, monitoring before banging the shutdown message makes for better trace, avoiding unnecessary noproc reasons when the process dies before the monitor is created.
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r--lib/diameter/src/base/diameter_service.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index 76b05a2ad4..f4afa6eb94 100644
--- a/lib/diameter/src/base/diameter_service.erl
+++ b/lib/diameter/src/base/diameter_service.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -610,8 +610,9 @@ st(#watchdog{ref = Ref, pid = Pid}, Refs) ->
%% st/3
st(#watchdog{pid = Pid}, Reason, Acc) ->
+ MRef = monitor(process, Pid),
Pid ! {shutdown, self(), Reason},
- [Pid | Acc].
+ [MRef | Acc].
%% ---------------------------------------------------------------------------
%% # call_service/2