aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2018-05-15 17:46:07 +0200
committerRickard Green <[email protected]>2018-05-15 19:54:59 +0200
commit0985a72500ecd46579f6f7462ff121cc2c015f1f (patch)
treeea617a1c34bb9fcac087d4102fae2bcee597d491 /erts/emulator/beam/erl_process.c
parent3b3e2f46841e3e86c991be92d62cbb0360ca80e3 (diff)
downloadotp-0985a72500ecd46579f6f7462ff121cc2c015f1f.tar.gz
otp-0985a72500ecd46579f6f7462ff121cc2c015f1f.tar.bz2
otp-0985a72500ecd46579f6f7462ff121cc2c015f1f.zip
Do not hold runq lock while deleting a process
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r--erts/emulator/beam/erl_process.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index ad7ac27ac3..70c50a6911 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -9610,6 +9610,17 @@ scheduler_gc_proc(Process *c_p, int reds_left)
return reds;
}
+static void
+unlock_lock_rq(int pre_free, void *vrq)
+{
+ ErtsRunQueue *rq = vrq;
+ if (pre_free)
+ erts_runq_unlock(rq);
+ else
+ erts_runq_lock(rq);
+}
+
+
/*
* schedule() is called from BEAM (process_main()) or HiPE
* (hipe_mode_switch()) when the current process is to be
@@ -9782,7 +9793,9 @@ Process *erts_schedule(ErtsSchedulerData *esdp, Process *p, int calls)
}
if (dec_refc)
- erts_proc_dec_refc(p);
+ erts_proc_dec_refc_free_func(p,
+ unlock_lock_rq,
+ (void *) rq);
}
ASSERT(!esdp->free_process);