mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 15:20:56 +00:00
lib/sync: Fix a race in unlocker logging (fixes #3884)
Other routines use atomics, hence even if we are under a lock, we should too. We might atomically store with Not sure how it happens, but it's between lines GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3974
This commit is contained in:
parent
72de47df00
commit
120e6eab2c
@ -123,7 +123,7 @@ func (m *loggedRWMutex) Lock() {
|
|||||||
|
|
||||||
atomic.StoreInt32(&m.logUnlockers, 1)
|
atomic.StoreInt32(&m.logUnlockers, 1)
|
||||||
m.RWMutex.Lock()
|
m.RWMutex.Lock()
|
||||||
m.logUnlockers = 0
|
atomic.StoreInt32(&m.logUnlockers, 0)
|
||||||
|
|
||||||
holder := getHolder()
|
holder := getHolder()
|
||||||
m.holder.Store(holder)
|
m.holder.Store(holder)
|
||||||
|
Loading…
Reference in New Issue
Block a user