From e9ffa6bab3583a4ddabe4f41218579503c8d4b95 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 1 Jun 2010 13:52:51 +0000 Subject: OTP-8612 Fix potential premature destruction of port locks Port locks could be prematurely destroyed. --- erts/emulator/beam/global.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'erts/emulator/beam/global.h') 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 } -- cgit v1.2.3