summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-01-12 23:14:19 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-01-12 23:19:56 +0000
commit3cb3972653c9b13b56c17db8d518815a80c842e4 (patch)
treea3efc9c4e631a39faf913999ad559dca2658a553 /storage
parente308c402b1e0790e735462eb9dfdd7a08dc98708 (diff)
Notify outside lock.
- Notify all if exclusive lock. - Notify one if no more shared locks.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
index 56b10a67a79..f9709479126 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
+++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
@@ -1185,7 +1185,12 @@ FileStorHandlerImpl::Stripe::release(const document::Bucket & bucket,
if (!entry._exclusiveLock && entry._sharedLocks.empty()) {
_lockedBuckets.erase(iter); // No more locks held
}
- _cond->notify_all();
+ guard.unlock();
+ if (entry._exclusiveLock) {
+ _cond->notify_all();
+ } else if (entry._sharedLocks.empty()) {
+ _cond->notify_one();
+ }
}
void