diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-09 19:34:04 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-11 10:19:18 +0000 |
commit | 6f67683319c6aeaf32b1341e5b11736106722d5c (patch) | |
tree | 760a0dbf2f8be9f6705548d15793779e9652f1be | |
parent | a8a0f4e973b3cfa54c0e9040a0a1ae15ffd6b3f8 (diff) |
Show that we hold the lock.
-rw-r--r-- | storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp | 9 | ||||
-rw-r--r-- | storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp index 86147eb7468..1d54992bfad 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp @@ -547,12 +547,13 @@ FileStorHandlerImpl::messageTimedOutInQueue(const api::StorageMessage& msg, std::unique_ptr<FileStorHandler::BucketLockInterface> FileStorHandlerImpl::takeDiskBucketLockOwnership( + const vespalib::MonitorGuard & guard, Disk& disk, const document::BucketId& id, const api::StorageMessage& msg) { return std::unique_ptr<FileStorHandler::BucketLockInterface>( - new BucketLock(disk, id, msg.getPriority(), msg.getSummary())); + new BucketLock(guard, disk, id, msg.getPriority(), msg.getSummary())); } std::unique_ptr<api::StorageReply> @@ -627,7 +628,7 @@ FileStorHandlerImpl::getNextMessage(uint16_t disk, uint8_t maxPriority) if (!messageTimedOutInQueue(*msg, waitTime)) { std::unique_ptr<FileStorHandler::BucketLockInterface> locker( - takeDiskBucketLockOwnership(t, id, *msg)); + takeDiskBucketLockOwnership(lockGuard, t, id, *msg)); MBUS_TRACE(trace, 9, "FileStorHandler: Got lock on bucket"); lockGuard.broadcast(); // XXX: needed here? lockGuard.unlock(); @@ -669,7 +670,7 @@ FileStorHandlerImpl::lock(const document::BucketId& bucket, uint16_t disk) } std::shared_ptr<FileStorHandler::BucketLockInterface> locker( - new BucketLock(t, bucket, 255, "External lock")); + new BucketLock(lockGuard, t, bucket, 255, "External lock")); lockGuard.broadcast(); return locker; @@ -1248,6 +1249,7 @@ FileStorHandlerImpl::getQueueSize(uint16_t disk) const } FileStorHandlerImpl::BucketLock::BucketLock( + const vespalib::MonitorGuard & guard, Disk& disk, const document::BucketId& id, uint8_t priority, @@ -1255,6 +1257,7 @@ FileStorHandlerImpl::BucketLock::BucketLock( : _disk(disk), _id(id) { + (void) guard; if (_id.getRawId() != 0) { // Lock the bucket and wait until it is not the current operation for // the disk itself. diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h index 27bb537ab18..da3abd17cdf 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h @@ -130,7 +130,7 @@ public: class BucketLock : public FileStorHandler::BucketLockInterface { public: - BucketLock(Disk& disk, const document::BucketId& id, uint8_t priority, + BucketLock(const vespalib::MonitorGuard & guard, Disk& disk, const document::BucketId& id, uint8_t priority, const vespalib::stringref & statusString); ~BucketLock(); @@ -260,7 +260,8 @@ private: * Disk lock MUST have been taken prior to calling this function. */ std::unique_ptr<FileStorHandler::BucketLockInterface> - takeDiskBucketLockOwnership(Disk& disk, const document::BucketId& id, const api::StorageMessage& msg); + takeDiskBucketLockOwnership(const vespalib::MonitorGuard & guard, + Disk& disk, const document::BucketId& id, const api::StorageMessage& msg); /** * Creates and returns a reply with api::TIMEOUT return code for msg. |