aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/global.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2010-06-01 13:52:51 +0000
committerErlang/OTP <[email protected]>2010-06-01 13:52:51 +0000
commite9ffa6bab3583a4ddabe4f41218579503c8d4b95 (patch)
tree290b913bc6960c3aebdb9c2e865ca84ea1ca483c /erts/emulator/beam/global.h
parentc68f1802ce375c3425795671c74c6b3fd9c3a8ef (diff)
downloadotp-e9ffa6bab3583a4ddabe4f41218579503c8d4b95.tar.gz
otp-e9ffa6bab3583a4ddabe4f41218579503c8d4b95.tar.bz2
otp-e9ffa6bab3583a4ddabe4f41218579503c8d4b95.zip
OTP-8612 Fix potential premature destruction of port locks
Port locks could be prematurely destroyed.
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r--erts/emulator/beam/global.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index 7c3ba69a65..d5d63631ff 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -1192,12 +1192,11 @@ erts_smp_port_unlock(Port *prt)
{
#ifdef ERTS_SMP
long refc;
+ erts_smp_mtx_unlock(prt->lock);
refc = erts_smp_atomic_dectest(&prt->refc);
ASSERT(refc >= 0);
if (refc == 0)
erts_port_cleanup(prt);
- else
- erts_smp_mtx_unlock(prt->lock);
#endif
}