diff options
author | Björn-Egil Dahlberg <[email protected]> | 2017-03-21 10:48:15 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2017-03-22 10:59:06 +0100 |
commit | 0dec7ddb341b2b7d2643f86dd9e9497b3f5268a7 (patch) | |
tree | ddd716eb7fa7a1b9bb7a66b9c014990f69077777 /erts/emulator/sys/common | |
parent | 303f4781e485f66e1eb6c5db77ff9523e5f69b7e (diff) | |
download | otp-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.c | 14 |
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); |