mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 15:20:56 +00:00
Reorder locking to avoid deadlock (fixes #64)
This commit is contained in:
parent
5daf6ecf70
commit
c171780c0d
@ -220,10 +220,10 @@ func (q *FileQueue) SetAvailable(file string, nodes []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (q *FileQueue) RemoveAvailable(toRemove string) {
|
func (q *FileQueue) RemoveAvailable(toRemove string) {
|
||||||
q.amut.Lock()
|
|
||||||
q.fmut.Lock()
|
q.fmut.Lock()
|
||||||
defer q.fmut.Unlock()
|
q.amut.Lock()
|
||||||
defer q.amut.Unlock()
|
defer q.amut.Unlock()
|
||||||
|
defer q.fmut.Unlock()
|
||||||
|
|
||||||
for file, nodes := range q.availability {
|
for file, nodes := range q.availability {
|
||||||
for i, node := range nodes {
|
for i, node := range nodes {
|
||||||
|
Loading…
Reference in New Issue
Block a user