aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/code_ix.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-02-21 20:43:23 +0100
committerSverker Eriksson <[email protected]>2012-02-23 12:15:36 +0100
commit17c62a8d1158e2c13be403e62d81140c705a8444 (patch)
tree4b829d8412d3249919fae342eb0b340b7cbf75a8 /erts/emulator/beam/code_ix.c
parentcebdde12c16ed51d2d714c4e68c24425f476e1f6 (diff)
downloadotp-17c62a8d1158e2c13be403e62d81140c705a8444.tar.gz
otp-17c62a8d1158e2c13be403e62d81140c705a8444.tar.bz2
otp-17c62a8d1158e2c13be403e62d81140c705a8444.zip
erts: Switch order between code_ix lock and thread blocking
Make for simpler code when we just can block threads and continue without having to release code_ix lock and repeat code lookups to avoid race.
Diffstat (limited to 'erts/emulator/beam/code_ix.c')
-rw-r--r--erts/emulator/beam/code_ix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/erts/emulator/beam/code_ix.c b/erts/emulator/beam/code_ix.c
index d4bf75558d..def7e164e2 100644
--- a/erts/emulator/beam/code_ix.c
+++ b/erts/emulator/beam/code_ix.c
@@ -105,6 +105,8 @@ int erts_try_lock_code_ix(Process* c_p)
{
int success;
+ ASSERT(!erts_smp_thr_progress_is_blocking());
+
erts_smp_mtx_lock(&the_code_ix_queue_lock);
success = !the_code_ix_lock;
if (success) {