diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-02-15 18:12:48 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-02-16 15:04:39 +0100 |
commit | 4ea67ffdac2629255b1b0ed4e9423823f62c0947 (patch) | |
tree | 0b47a8b303deec5c535ae6d54b5a277b9f432b84 /erts/preloaded/src/erts_internal.erl | |
parent | f5a6e1c353e2a7fb536dcac4523e4f6e3d99039b (diff) | |
download | otp-4ea67ffdac2629255b1b0ed4e9423823f62c0947.tar.gz otp-4ea67ffdac2629255b1b0ed4e9423823f62c0947.tar.bz2 otp-4ea67ffdac2629255b1b0ed4e9423823f62c0947.zip |
erts: Add BIF erts_internal:system_check/1
This commit implements erts_internal:system_check(schedulers) with the
intent of a basic responsiveness test check of the schedulers.
Diffstat (limited to 'erts/preloaded/src/erts_internal.erl')
-rw-r--r-- | erts/preloaded/src/erts_internal.erl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/erts/preloaded/src/erts_internal.erl b/erts/preloaded/src/erts_internal.erl index 7ed4efea4b..6db77a8482 100644 --- a/erts/preloaded/src/erts_internal.erl +++ b/erts/preloaded/src/erts_internal.erl @@ -35,6 +35,9 @@ -export([port_command/3, port_connect/2, port_close/1, port_control/3, port_call/3, port_info/1, port_info/2]). +-export([system_check/1, + gather_system_check_result/1]). + -export([request_system_task/3]). -export([check_process_code/2]). @@ -197,6 +200,23 @@ request_system_task(_Pid, _Prio, _Request) -> check_process_code(_Module, _OptionList) -> erlang:nif_error(undefined). +-spec system_check(Type) -> 'ok' when + Type :: 'schedulers'. + +system_check(_Type) -> + erlang:nif_error(undefined). + +gather_system_check_result(Ref) when is_reference(Ref) -> + gather_system_check_result(Ref, erlang:system_info(schedulers)). + +gather_system_check_result(_Ref, 0) -> + ok; +gather_system_check_result(Ref, N) -> + receive + Ref -> + gather_system_check_result(Ref, N - 1) + end. + %% term compare where integer() < float() = true -spec cmp_term(A,B) -> Result when |