aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/heart.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-02-25 15:13:32 +0100
committerBjörn-Egil Dahlberg <[email protected]>2016-02-25 15:26:28 +0100
commit0ca09ee90d6384e74d1b18ab0e05f2c05fc03905 (patch)
treecee20d57c9b84f1720e36b75fc93c949906e85df /lib/kernel/src/heart.erl
parentbedde8c59e568b15bee4b36dc4e4eaa93d00f63a (diff)
downloadotp-0ca09ee90d6384e74d1b18ab0e05f2c05fc03905.tar.gz
otp-0ca09ee90d6384e74d1b18ab0e05f2c05fc03905.tar.bz2
otp-0ca09ee90d6384e74d1b18ab0e05f2c05fc03905.zip
kernel: Clarify heart option
Change scheduler responsiveness to 'check_schedulers'.
Diffstat (limited to 'lib/kernel/src/heart.erl')
-rw-r--r--lib/kernel/src/heart.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/kernel/src/heart.erl b/lib/kernel/src/heart.erl
index 273bdcb352..d14598cd05 100644
--- a/lib/kernel/src/heart.erl
+++ b/lib/kernel/src/heart.erl
@@ -53,9 +53,14 @@
-define(CYCLE_TIMEOUT, 10000).
-define(HEART_PORT_NAME, heart_port).
+%% valid heart options
+-define(SCHEDULER_CHECK_OPT, check_schedulers).
+
+-type heart_option() :: ?SCHEDULER_CHECK_OPT.
+
-record(state,{port :: port(),
cmd :: [] | binary(),
- options :: [atom()],
+ options :: [heart_option()],
callback :: 'undefined' | {atom(), atom()}}).
%%---------------------------------------------------------------------
@@ -144,7 +149,7 @@ clear_callback() ->
wait().
-spec set_options(Options) -> 'ok' | {'error', {'bad_options', Options}} when
- Options :: [atom()].
+ Options :: [heart_option()].
set_options(Options) ->
?MODULE ! {self(), set_options, Options},
@@ -314,7 +319,7 @@ no_reboot_shutdown(Port) ->
validate_options(Opts) -> validate_options(Opts,[]).
validate_options([],Res) -> Res;
-validate_options([scheduler=Opt|Opts],Res) -> validate_options(Opts,[Opt|Res]);
+validate_options([?SCHEDULER_CHECK_OPT=Opt|Opts],Res) -> validate_options(Opts,[Opt|Res]);
validate_options(_,_) -> error.
do_cycle_port_program(Caller, Parent, #state{port=Port} = S) ->
@@ -365,7 +370,7 @@ get_heart_cmd(Port) ->
end.
check_system([]) -> ok;
-check_system([scheduler|Opts]) ->
+check_system([?SCHEDULER_CHECK_OPT|Opts]) ->
ok = erts_internal:system_check(schedulers),
check_system(Opts).