aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-08-16 17:37:01 +0200
committerLukas Larsson <[email protected]>2017-08-16 17:38:36 +0200
commitddb348c31e75bfa895c0959ef1e16c9e43917e8a (patch)
tree3e38581a35fec11b4fb794f3486c02e717c5961d /erts/emulator/beam/erl_nif.c
parent856eb2e75ec0ed37c7dedaeb0772803988ffee82 (diff)
parent33b3697ae98147e0470d8d08bca6c51042dcb3d1 (diff)
downloadotp-ddb348c31e75bfa895c0959ef1e16c9e43917e8a.tar.gz
otp-ddb348c31e75bfa895c0959ef1e16c9e43917e8a.tar.bz2
otp-ddb348c31e75bfa895c0959ef1e16c9e43917e8a.zip
Merge branch 'maint'
Conflicts: erts/emulator/beam/erl_nif.c erts/emulator/beam/erl_process.c
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 9ffb53d532..05bcf73451 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -587,6 +587,10 @@ int erts_flush_trace_messages(Process *c_p, ErtsProcLocks c_p_locks)
ErlTraceMessageQueue *msgq, **last_msgq;
int reds = 0;
+ /* Only one thread at a time is allowed to flush trace messages,
+ so we require the main lock to be held when doing the flush */
+ ERTS_CHK_HAVE_ONLY_MAIN_PROC_LOCK(c_p);
+
erts_proc_lock(c_p, ERTS_PROC_LOCK_TRACE);
msgq = c_p->trace_msg_q;