diff options
author | Rickard Green <[email protected]> | 2011-05-11 14:52:38 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2011-05-11 14:52:38 +0200 |
commit | 116deb98aa1309039d06530de3351feec1163c3f (patch) | |
tree | 34e98231f345dec4992d22fdb5068a943842a524 /erts/emulator/beam/beam_bif_load.c | |
parent | 68fe6a14539b82250373ef114d6576e74e1b8f2e (diff) | |
parent | aeda9e6b3b28849a27b0f4f5386d000e40a198d0 (diff) | |
download | otp-116deb98aa1309039d06530de3351feec1163c3f.tar.gz otp-116deb98aa1309039d06530de3351feec1163c3f.tar.bz2 otp-116deb98aa1309039d06530de3351feec1163c3f.zip |
Merge branch 'rickard/gc-other/OTP-9211' into dev
* rickard/gc-other/OTP-9211:
Fix bad assertions
Avoid scheduling of processes being garbage collected by others
Diffstat (limited to 'erts/emulator/beam/beam_bif_load.c')
-rw-r--r-- | erts/emulator/beam/beam_bif_load.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c index 1ca405961f..1dbf6f9b92 100644 --- a/erts/emulator/beam/beam_bif_load.c +++ b/erts/emulator/beam/beam_bif_load.c @@ -175,8 +175,12 @@ check_process_code_2(BIF_ALIST_2) Eterm res; if (internal_pid_index(BIF_ARG_1) >= erts_max_processes) goto error; - rp = erts_pid2proc_not_running(BIF_P, ERTS_PROC_LOCK_MAIN, - BIF_ARG_1, ERTS_PROC_LOCK_MAIN); +#ifdef ERTS_SMP + rp = erts_pid2proc_suspend(BIF_P, ERTS_PROC_LOCK_MAIN, + BIF_ARG_1, ERTS_PROC_LOCK_MAIN); +#else + rp = erts_pid2proc(BIF_P, 0, BIF_ARG_1, 0); +#endif if (!rp) { BIF_RET(am_false); } @@ -187,8 +191,10 @@ check_process_code_2(BIF_ALIST_2) modp = erts_get_module(BIF_ARG_2); res = check_process_code(rp, modp); #ifdef ERTS_SMP - if (BIF_P != rp) + if (BIF_P != rp) { + erts_resume(rp, ERTS_PROC_LOCK_MAIN); erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_MAIN); + } #endif BIF_RET(res); } |