fix: revert chain sync mutex to a regular lock
Conditions always call "unlock" so we can't safely use the condition with both the read and write side of lock. So we might as well revert back to a regular lock. fixes #10616
This commit is contained in:
parent
d77ac5ddcb
commit
34f46d736f
@ -188,7 +188,7 @@ type SplitStore struct {
|
||||
cancel func()
|
||||
|
||||
outOfSync int32 // for fast checking
|
||||
chainSyncMx sync.RWMutex
|
||||
chainSyncMx sync.Mutex
|
||||
chainSyncCond sync.Cond
|
||||
chainSyncFinished bool // protected by chainSyncMx
|
||||
|
||||
|
@ -917,8 +917,8 @@ func (s *SplitStore) waitForSync() {
|
||||
if atomic.LoadInt32(&s.outOfSync) == 0 {
|
||||
return
|
||||
}
|
||||
s.chainSyncMx.RLock()
|
||||
defer s.chainSyncMx.RUnlock()
|
||||
s.chainSyncMx.Lock()
|
||||
defer s.chainSyncMx.Unlock()
|
||||
|
||||
for !s.chainSyncFinished {
|
||||
s.chainSyncCond.Wait()
|
||||
|
Loading…
Reference in New Issue
Block a user