aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-02-20 20:20:29 +0100
committerSverker Eriksson <[email protected]>2017-02-20 20:20:29 +0100
commitaf7cf70ca22a34add7836963d086ca0764f4fbae (patch)
tree2c9dbcbb87fbb71142ac2356c1661e79cbb706ec /erts/emulator/beam/erl_nif.c
parentd8d8301a252579a000b24bab87d26549da0e813a (diff)
downloadotp-af7cf70ca22a34add7836963d086ca0764f4fbae.tar.gz
otp-af7cf70ca22a34add7836963d086ca0764f4fbae.tar.bz2
otp-af7cf70ca22a34add7836963d086ca0764f4fbae.zip
Fix ErlNifMonitor handling
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index daec4ac9e9..e6da4c1a76 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -2305,9 +2305,6 @@ void erts_resource_stop(ErtsResource* resource, ErlNifEvent e,
post_nif_noproc(&msg_env);
}
-/* SVERK SVERK: Move to ?.h */
-void erts_ref_to_driver_monitor(Eterm ref, ErlDrvMonitor*);
-
void erts_fire_nif_monitor(ErtsResource* resource, Eterm pid, Eterm ref)
{
ErtsMonitor* rmon;
@@ -3207,8 +3204,8 @@ int enif_demonitor_process(ErlNifEnv* env, void* obj, const ErlNifMonitor* monit
execution_state(env, NULL, &scheduler);
- memcpy(ref_heap, monitor, sizeof(Eterm)*ERTS_REF_THING_SIZE);
- ref = make_internal_ref(ref_heap);
+ ref = erts_driver_monitor_to_ref(ref_heap, monitor);
+
erts_smp_mtx_lock(&rsrc->monitors->lock);
mon = erts_remove_monitor(&rsrc->monitors->root, ref);