aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/bif.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2010-12-17 12:49:14 +0100
committerRickard Green <[email protected]>2010-12-17 12:49:14 +0100
commit962a313807f96f38f3bf40a5e8cd855ad09deccb (patch)
tree0b747d347295531b54e0d3e5e3a8fc1611197ba4 /erts/emulator/beam/bif.c
parent1b5f4da2d59f3d42a5e7bb1f7aa1d65436bc2ef5 (diff)
parent264f3beaa4eec74244c6ed66d31e48ae5025df51 (diff)
downloadotp-962a313807f96f38f3bf40a5e8cd855ad09deccb.tar.gz
otp-962a313807f96f38f3bf40a5e8cd855ad09deccb.tar.bz2
otp-962a313807f96f38f3bf40a5e8cd855ad09deccb.zip
Merge branch 'rickard/exit/2-refc/OTP-9005' into dev
* rickard/exit/2-refc/OTP-9005: Decrement refc after unlock in exit/2
Diffstat (limited to 'erts/emulator/beam/bif.c')
-rw-r--r--erts/emulator/beam/bif.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index d4a43f6e5f..bb237e378a 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -1351,9 +1351,10 @@ BIF_RETTYPE exit_2(BIF_ALIST_2)
#ifdef ERTS_SMP
if (rp == BIF_P)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
- else
+ if (rp_locks)
+ erts_smp_proc_unlock(rp, rp_locks);
+ if (rp != BIF_P)
erts_smp_proc_dec_refc(rp);
- erts_smp_proc_unlock(rp, rp_locks);
#endif
/*
* We may have exited ourselves and may have to take action.