MB-16357: Create a variable to get correct locking scope 76/56976/2
authorJim Walker <jim@couchbase.com>
Thu, 12 Nov 2015 12:04:56 +0000 (12:04 +0000)
committerChiyoung Seo <chiyoung@couchbase.com>
Thu, 12 Nov 2015 16:36:54 +0000 (16:36 +0000)
A mistake in 495e00acc24 means that no variable is
created for the ReaderLockHolder, the compiler either
optimises away the lock constructor/destructor or the lock
scope is wrong.

Either way we need to create a variable.

Change-Id: I642ac64d71b73d3d78207ff50d33539a06ce0e7e
Reviewed-on: http://review.couchbase.org/56976
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
src/ep.cc

index 3d78374..b4e4f40 100644 (file)
--- a/src/ep.cc
+++ b/src/ep.cc
@@ -486,7 +486,7 @@ EventuallyPersistentStore::deleteExpiredItem(uint16_t vbid, std::string &key,
     if (vb) {
         // Obtain reader access to the VB state change lock so that
         // the VB can't switch state whilst we're processing
-        ReaderLockHolder(vb->getStateLock());
+        ReaderLockHolder rlh(vb->getStateLock());
         if (vb->getState() == vbucket_state_active) {
             int bucket_num(0);
             incExpirationStat(vb);