mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Avoid fatal error: sync: Unlock of unlocked RWMutex
fix https://github.com/chrislusf/seaweedfs/issues/3306
This commit is contained in:
parent
31f9f528db
commit
1451b389a4
|
@ -18,7 +18,7 @@ type ReaderCache struct {
|
|||
}
|
||||
|
||||
type SingleChunkCacher struct {
|
||||
sync.RWMutex
|
||||
sync.Mutex
|
||||
cond *sync.Cond
|
||||
parent *ReaderCache
|
||||
chunkFileId string
|
||||
|
@ -183,8 +183,8 @@ func (s *SingleChunkCacher) destroy() {
|
|||
}
|
||||
|
||||
func (s *SingleChunkCacher) readChunkAt(buf []byte, offset int64) (int, error) {
|
||||
s.RLock()
|
||||
defer s.RUnlock()
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
for s.completedTime.IsZero() {
|
||||
s.cond.Wait()
|
||||
|
|
Loading…
Reference in a new issue