From 8af631a6456bc683f09f9d0e321e8bdb1cd4e093 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 7 Jan 2019 19:40:15 +0000 Subject: Don't hold a shared lock whilst waiting for BG ops to complete 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 --- netfs/fuse/fuseFiles.cpp | 7 +++++-- 1 file 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() 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(); } } -- cgit v1.2.3