From: VMware, Inc <> Date: Thu, 17 Jun 2010 21:26:17 +0000 (-0700) Subject: lib/lock: RW lock assertion failure X-Git-Tag: 2010.06.16-268169~129 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac93ddc3ff84acecb1ca13f23ae9c41d9dc6fdc0;p=thirdparty%2Fopen-vm-tools.git lib/lock: RW lock assertion failure The MXUser RW lock release code has a bug in it... it asserts on an unexpected reference count. The bug was caused by not decrementing the reference count before the assertion. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/lock/ulRW.c b/open-vm-tools/lib/lock/ulRW.c index 5d7ab81cf..c4d83ae16 100644 --- a/open-vm-tools/lib/lock/ulRW.c +++ b/open-vm-tools/lib/lock/ulRW.c @@ -822,6 +822,8 @@ MXUser_ReleaseRWLock(MXUserRWLock *lock) // IN/OUT: MXUserReleaseTracking(&lock->header); + Atomic_Dec(&lock->holderCount); + if (LIKELY(lock->useNative)) { int err = MXUserNativeRWRelease(&lock->nativeLock, myContext->state); @@ -835,7 +837,6 @@ MXUser_ReleaseRWLock(MXUserRWLock *lock) // IN/OUT: } myContext->state = RW_UNLOCKED; - Atomic_Dec(&lock->holderCount); } /*