diff options
author | Lukas Larsson <[email protected]> | 2015-08-10 15:23:38 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2015-08-10 15:23:38 +0200 |
commit | de73ff17c737a24a322b260f75d69e61f3586328 (patch) | |
tree | d0fd13d94c826f48f8c2076bdd5d2f043c41acd9 | |
parent | ee5587d585052fe7b64c972029a6c68c403b71dc (diff) | |
parent | 79b504ca9134121a63c049292d8636d3cd0d99b4 (diff) | |
download | otp-de73ff17c737a24a322b260f75d69e61f3586328.tar.gz otp-de73ff17c737a24a322b260f75d69e61f3586328.tar.bz2 otp-de73ff17c737a24a322b260f75d69e61f3586328.zip |
Merge branch 'sverk/smp-trace-port-exit-bug/OTP-12901' into maint
* sverk/smp-trace-port-exit-bug/OTP-12901:
Teach smp VM how to deal with crash of a linked trace port
-rw-r--r-- | erts/emulator/beam/erl_process.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index ee1dd36d48..9a2ec40a06 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -11522,10 +11522,14 @@ save_pending_exiter(Process *p) { ErtsProcList *plp; ErtsRunQueue *rq; + ErtsSchedulerData *esdp = erts_get_scheduler_data(); ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p)); - rq = erts_get_runq_current(NULL); + if (!esdp) + rq = RUNQ_READ_RQ(&p->run_queue); + else + rq = esdp->run_queue; plp = proclist_create(p); @@ -11542,6 +11546,7 @@ save_pending_exiter(Process *p) else #endif wake_scheduler(rq); + } #endif @@ -11730,23 +11735,21 @@ send_exit_signal(Process *c_p, /* current process if and only if (need_locks && erts_smp_proc_trylock(rp, need_locks) == EBUSY) { /* ... but we havn't got all locks on it ... */ - save_pending_exiter(rp); + save_pending_exiter(rp); /* * The pending exit will be discovered when next * process is scheduled in */ - goto set_pending_exit; - } - else { - /* ...and we have all locks on it... */ - *rp_locks = ERTS_PROC_LOCKS_ALL; - set_proc_exiting(rp, - state, - (is_immed(rsn) - ? rsn - : copy_object(rsn, rp)), - NULL); + goto set_pending_exit; } + /* ...and we have all locks on it... */ + *rp_locks = ERTS_PROC_LOCKS_ALL; + set_proc_exiting(rp, + state, + (is_immed(rsn) + ? rsn + : copy_object(rsn, rp)), + NULL); } else { /* Process running... */ |