diff options
author | Sverker Eriksson <sverker@erlang.org> | 2019-03-14 20:19:11 +0100 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2020-02-04 13:15:14 +0100 |
commit | 75d4701fff0520d94bb102e51e0c7dfee34337c1 (patch) | |
tree | e7eb9327c6ebcb24c2c0a6f99d6a0662d462379e /erts/emulator/beam/beam_bif_load.c | |
parent | 7d0737b80f1a8976825750765bf26a0fa80ad3a5 (diff) | |
download | erlang-75d4701fff0520d94bb102e51e0c7dfee34337c1.tar.gz |
erts: Make load_nif/2 nonblocking
Diffstat (limited to 'erts/emulator/beam/beam_bif_load.c')
-rw-r--r-- | erts/emulator/beam/beam_bif_load.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c index 42c9d35786..e130baa1c0 100644 --- a/erts/emulator/beam/beam_bif_load.c +++ b/erts/emulator/beam/beam_bif_load.c @@ -2047,23 +2047,22 @@ BIF_RETTYPE erts_internal_purge_module_2(BIF_ALIST_2) ERTS_BIF_PREP_RET(ret, am_false); } else { - /* - * Unload any NIF library - */ - if (modp->old.nif != NULL - || IF_HIPE(hipe_purge_need_blocking(modp))) { - /* ToDo: Do unload nif without blocking */ + if (IF_HIPE(hipe_purge_need_blocking(modp))) { erts_rwunlock_old_code(code_ix); erts_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN); erts_thr_progress_block(); is_blocking = 1; erts_rwlock_old_code(code_ix); - if (modp->old.nif) { - erts_unload_nif(modp->old.nif); - modp->old.nif = NULL; - } } + /* + * Unload any NIF library + */ + if (modp->old.nif) { + erts_unload_nif(modp->old.nif); + modp->old.nif = NULL; + } + /* * Remove the old code. */ |