aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/common
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2017-03-21 10:48:15 +0100
committerBjörn-Egil Dahlberg <[email protected]>2017-03-22 10:59:06 +0100
commit0dec7ddb341b2b7d2643f86dd9e9497b3f5268a7 (patch)
treeddd716eb7fa7a1b9bb7a66b9c014990f69077777 /erts/emulator/sys/common
parent303f4781e485f66e1eb6c5db77ff9523e5f69b7e (diff)
downloadotp-0dec7ddb341b2b7d2643f86dd9e9497b3f5268a7.tar.gz
otp-0dec7ddb341b2b7d2643f86dd9e9497b3f5268a7.tar.bz2
otp-0dec7ddb341b2b7d2643f86dd9e9497b3f5268a7.zip
erts: Don't allocate memory during signal handling
Allocations and message sending are now scheduled by a signal, via a signal state bitmap, instead of doing it directly in the signal handler.
Diffstat (limited to 'erts/emulator/sys/common')
-rw-r--r--erts/emulator/sys/common/erl_check_io.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/erts/emulator/sys/common/erl_check_io.c b/erts/emulator/sys/common/erl_check_io.c
index 1ef9fa2a05..00c70268df 100644
--- a/erts/emulator/sys/common/erl_check_io.c
+++ b/erts/emulator/sys/common/erl_check_io.c
@@ -2169,6 +2169,12 @@ ERTS_CIO_EXPORT(erts_check_io)(int do_wait)
erts_do_break_handling();
#endif
+#ifdef ERTS_SIGNAL_STATE /* ifndef ERTS_SMP */
+ if (ERTS_SIGNAL_STATE) {
+ erts_handle_signal_state();
+ }
+#endif
+
/* Figure out timeout value */
timeout_time = (do_wait
? erts_check_next_timeout_time(esdp)
@@ -2207,6 +2213,14 @@ ERTS_CIO_EXPORT(erts_check_io)(int do_wait)
erts_do_break_handling();
#endif
+
+#ifdef ERTS_SIGNAL_STATE /* ifndef ERTS_SMP */
+ if (ERTS_SIGNAL_STATE) {
+ erts_handle_signal_state();
+ }
+#endif
+
+
if (poll_ret != 0) {
erts_smp_atomic_set_nob(&pollset.in_poll_wait, 0);
forget_removed(&pollset);