mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 07:11:08 +00:00
lib/model: Release both locks when waiting for services to stop (fixes #5028)
This commit is contained in:
parent
c2784d76e4
commit
b91ff430db
@ -344,11 +344,13 @@ func (m *Model) tearDownFolderLocked(cfg config.FolderConfiguration) {
|
|||||||
// Stop the services running for this folder and wait for them to finish
|
// Stop the services running for this folder and wait for them to finish
|
||||||
// stopping to prevent races on restart.
|
// stopping to prevent races on restart.
|
||||||
tokens := m.folderRunnerTokens[cfg.ID]
|
tokens := m.folderRunnerTokens[cfg.ID]
|
||||||
|
m.pmut.Unlock()
|
||||||
m.fmut.Unlock()
|
m.fmut.Unlock()
|
||||||
for _, id := range tokens {
|
for _, id := range tokens {
|
||||||
m.RemoveAndWait(id, 0)
|
m.RemoveAndWait(id, 0)
|
||||||
}
|
}
|
||||||
m.fmut.Lock()
|
m.fmut.Lock()
|
||||||
|
m.pmut.Lock()
|
||||||
|
|
||||||
// Close connections to affected devices
|
// Close connections to affected devices
|
||||||
for _, dev := range cfg.Devices {
|
for _, dev := range cfg.Devices {
|
||||||
|
Loading…
Reference in New Issue
Block a user