aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-04-13 18:03:33 +0200
committerBjörn-Egil Dahlberg <[email protected]>2017-01-05 10:29:45 +0100
commitc9060f9b4289bf9a669ac651a1a7aeb97a28652c (patch)
tree82fba1108c2c149ea9ecbb10f10b85b53261ee1d /erts/emulator/beam
parentdc72c879b68fdf96edfec360e8c311ff7389ecc6 (diff)
downloadotp-c9060f9b4289bf9a669ac651a1a7aeb97a28652c.tar.gz
otp-c9060f9b4289bf9a669ac651a1a7aeb97a28652c.tar.bz2
otp-c9060f9b4289bf9a669ac651a1a7aeb97a28652c.zip
erts: Add SIGHUP signal handler
A received SIGHUP signal to beam will generate a '{notify, sighup}' message to the registered process 'erl_signal_server'. 'erl_signal_server' is a gen_event process.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/atom.names2
-rw-r--r--erts/emulator/beam/register.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/erts/emulator/beam/atom.names b/erts/emulator/beam/atom.names
index b1aeed7889..363b17e27c 100644
--- a/erts/emulator/beam/atom.names
+++ b/erts/emulator/beam/atom.names
@@ -239,6 +239,7 @@ atom Eq='=:='
atom Eqeq='=='
atom erl_tracer
atom erlang
+atom erl_signal_server
atom ERROR='ERROR'
atom error_handler
atom error_logger
@@ -590,6 +591,7 @@ atom set_tcw
atom set_tcw_fake
atom separate
atom shared
+atom sighup
atom silent
atom size
atom sl_alloc
diff --git a/erts/emulator/beam/register.c b/erts/emulator/beam/register.c
index acda51c9fc..7f60710124 100644
--- a/erts/emulator/beam/register.c
+++ b/erts/emulator/beam/register.c
@@ -272,13 +272,13 @@ erts_whereis_name_to_id(Process *c_p, Eterm name)
int ix;
HashBucket* b;
#ifdef ERTS_SMP
- ErtsProcLocks c_p_locks = c_p ? ERTS_PROC_LOCK_MAIN : 0;
-
-#ifdef ERTS_ENABLE_LOCK_CHECK
- if (c_p) ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(c_p);
-#endif
-
+ ErtsProcLocks c_p_locks = 0;
+ if (c_p) {
+ c_p_locks = ERTS_PROC_LOCK_MAIN;
+ ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(c_p);
+ }
reg_safe_read_lock(c_p, &c_p_locks);
+
if (c_p && !c_p_locks)
erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MAIN);
#endif