Skip to content

Commit 86e35f1

Browse files
imsodincalmh
authored andcommitted
lib/model: Less locking in ClusterConfig (syncthing#5943)
1 parent 720a6bf commit 86e35f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/model/model.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,7 @@ func (m *model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
10621062
}
10631063
}
10641064

1065-
m.fmut.Lock()
1066-
defer m.fmut.Unlock()
1065+
m.fmut.RLock()
10671066
var paused []string
10681067
for _, folder := range cm.Folders {
10691068
cfg, ok := m.cfg.Folder(folder.ID)
@@ -1184,6 +1183,7 @@ func (m *model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
11841183
// implementing suture.IsCompletable).
11851184
m.Add(is)
11861185
}
1186+
m.fmut.RUnlock()
11871187

11881188
m.pmut.Lock()
11891189
m.remotePausedFolders[deviceID] = paused

0 commit comments

Comments
 (0)