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()
|
cancel func()
|
||||||
|
|
||||||
outOfSync int32 // for fast checking
|
outOfSync int32 // for fast checking
|
||||||
chainSyncMx sync.RWMutex
|
chainSyncMx sync.Mutex
|
||||||
chainSyncCond sync.Cond
|
chainSyncCond sync.Cond
|
||||||
chainSyncFinished bool // protected by chainSyncMx
|
chainSyncFinished bool // protected by chainSyncMx
|
||||||
|
|
||||||
|
@ -917,8 +917,8 @@ func (s *SplitStore) waitForSync() {
|
|||||||
if atomic.LoadInt32(&s.outOfSync) == 0 {
|
if atomic.LoadInt32(&s.outOfSync) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.chainSyncMx.RLock()
|
s.chainSyncMx.Lock()
|
||||||
defer s.chainSyncMx.RUnlock()
|
defer s.chainSyncMx.Unlock()
|
||||||
|
|
||||||
for !s.chainSyncFinished {
|
for !s.chainSyncFinished {
|
||||||
s.chainSyncCond.Wait()
|
s.chainSyncCond.Wait()
|
||||||
|
Loading…
Reference in New Issue
Block a user