aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src/si_sasl_supp.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-03-08 14:42:03 +0100
committerBjörn Gustavsson <[email protected]>2010-03-08 15:36:00 +0100
commitdff8572b12a00155e2cf6f21677af6dd9a3ffeb6 (patch)
treee18eefe6f1435ad100f4a25f5e83000c85c58f8c /lib/sasl/src/si_sasl_supp.erl
parentdfd80f7cea795bfb3a35eaea2c0bc98960002aa2 (diff)
downloadotp-dff8572b12a00155e2cf6f21677af6dd9a3ffeb6.tar.gz
otp-dff8572b12a00155e2cf6f21677af6dd9a3ffeb6.tar.bz2
otp-dff8572b12a00155e2cf6f21677af6dd9a3ffeb6.zip
sasl: Use gen_server:call/3 with infinity timeout
gen_server:call/2,3 now sets up a monitor to make sure that it will be noticed if the called process dies. Therefore, there is almost never a good reason to use gen_server:call/2 with its default 5 seconds timeout. Use gen_server:call/3 with the 'infinity' timeout instead. To make sure we use the 'infinity' timeout every time, wrap the to call gen_server:call/3 in a local call/1 function in each module.
Diffstat (limited to 'lib/sasl/src/si_sasl_supp.erl')
-rw-r--r--lib/sasl/src/si_sasl_supp.erl14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/sasl/src/si_sasl_supp.erl b/lib/sasl/src/si_sasl_supp.erl
index 52dbed2e00..c64e256115 100644
--- a/lib/sasl/src/si_sasl_supp.erl
+++ b/lib/sasl/src/si_sasl_supp.erl
@@ -57,13 +57,13 @@
h() -> print_help().
help() -> print_help().
-si_exec(Fun, Args) -> gen_server:call(si_server, {si_exec, Fun, Args}).
+si_exec(Fun, Args) -> call({si_exec, Fun, Args}).
start_log(FileName) ->
- gen_server:call(si_server, {start_log, FileName}).
+ call({start_log, FileName}).
stop_log() ->
- gen_server:call(si_server, stop_log).
+ call(stop_log).
abbrevs() ->
io:format("~p", [process_abbrevs()]).
@@ -123,7 +123,7 @@ start_link(_Options) ->
gen_server:start_link({local, si_server}, si_sasl_supp, [], []).
stop() ->
- gen_server:call(si_server, stop),
+ call(stop),
supervisor:delete_child(sasl_sup, si_server).
@@ -208,6 +208,12 @@ open_log_file(FileName) ->
%% 3. Code
%%--------------------------------------------------
+%%-----------------------------------------------------------------
+%% call(Request) -> Term
+%%-----------------------------------------------------------------
+call(Req) ->
+ gen_server:call(si_server, Req, infinity).
+
%%--------------------------------------------------
%% Makes a Pid of almost anything.
%% Returns: Pid|{error, Reason}