aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-05-22 17:28:11 +0200
committerLukas Larsson <[email protected]>2017-10-12 17:34:57 +0200
commit19c5a5f7f15d02395694b32090d1b24c3934c5d8 (patch)
tree000235e7e3ee80978a9c20f5a50dd5c344b4c792 /erts/emulator/beam
parent4c42d5b93e32444f185043e74c9b408cd76dc661 (diff)
downloadotp-19c5a5f7f15d02395694b32090d1b24c3934c5d8.tar.gz
otp-19c5a5f7f15d02395694b32090d1b24c3934c5d8.tar.bz2
otp-19c5a5f7f15d02395694b32090d1b24c3934c5d8.zip
erts: Use SIGRTMIN on linux for sys_suspend
The Linux real-time signal is better used on Linux for suspending schedulers during shutdown as it doesn't collide with SIGUSR2 usage of other applications.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_bif_info.c6
-rw-r--r--erts/emulator/beam/sys.h11
2 files changed, 14 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index 2ff95a3338..162d179982 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -3699,6 +3699,12 @@ BIF_RETTYPE erts_debug_get_internal_state_1(BIF_ALIST_1)
Eterm *hp = HAlloc(BIF_P, hsz);
BIF_RET(uword_to_big(size, hp));
}
+ } else if (ERTS_IS_ATOM_STR("scheduler_dump", BIF_ARG_1)) {
+#if defined(ERTS_HAVE_TRY_CATCH) && defined(ERTS_SYS_SUSPEND_SIGNAL)
+ BIF_RET(am_true);
+#else
+ BIF_RET(am_false);
+#endif
}
}
else if (is_tuple(BIF_ARG_1)) {
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h
index 615f44364b..9dc339053f 100644
--- a/erts/emulator/beam/sys.h
+++ b/erts/emulator/beam/sys.h
@@ -832,11 +832,16 @@ int erts_sys_unsetenv(char *key);
char *erts_read_env(char *key);
void erts_free_read_env(void *value);
-#if defined(ERTS_THR_HAVE_SIG_FUNCS) && !defined(ETHR_UNUSABLE_SIGUSRX)
+#if defined(ERTS_THR_HAVE_SIG_FUNCS) && \
+ (!defined(ETHR_UNUSABLE_SIGUSRX) || defined(SIGRTMIN))
extern void sys_thr_resume(erts_tid_t tid);
extern void sys_thr_suspend(erts_tid_t tid);
-#define ERTS_SYS_SUSPEND_SIGNAL SIGUSR2
-#endif
+#ifdef SIGRTMIN
+#define ERTS_SYS_SUSPEND_SIGNAL (SIGRTMIN+1)
+#else
+#define ERTS_SYS_SUSPEND_SIGNAL (SIGUSR2)
+#endif /* SIGRTMIN */
+#endif /* HAVE_SIG_FUNCS */
/* utils.c */