summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-01-07 19:40:15 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-01-07 19:40:15 +0000
commit8af631a6456bc683f09f9d0e321e8bdb1cd4e093 (patch)
tree3a245047dcd2ec99161f4b330bb7e28bdd74ef0a
parentDon't mix and match [a]sync read/write operations (diff)
downloadnetfs-8af631a6456bc683f09f9d0e321e8bdb1cd4e093.tar.bz2
netfs-8af631a6456bc683f09f9d0e321e8bdb1cd4e093.tar.xz
netfs-8af631a6456bc683f09f9d0e321e8bdb1cd4e093.zip
Don't hold a shared lock whilst waiting for BG ops to completenetfs-1.3.1
Just hold the lock whilst the BG op list is copied... then just wait on the operations which were in-progress at the time of copy
-rw-r--r--netfs/fuse/fuseFiles.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp
index e56ce0b..b8eb014 100644
--- a/netfs/fuse/fuseFiles.cpp
+++ b/netfs/fuse/fuseFiles.cpp
@@ -28,8 +28,11 @@ FuseApp::getMap<FuseApp::OpenFilePtr>()
void
FuseApp::OpenFile::wait() const
{
- SharedLock(_lock);
- for (const auto & w : bg) {
+ auto cbg = [this](){
+ SharedLock(_lock);
+ return bg;
+ }();
+ for (const auto & w : cbg) {
w.second->future.wait();
}
}