Skip to content

Commit 3e82312

Browse files
fix shared data delete due to concurrent map writes (#271)
1 parent 04006cf commit 3e82312

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

data/scope.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ func (s *SimpleSyncScope) GetValue(name string) (value interface{}, exists bool)
9393

9494
// Delete implements Scope.GetValue
9595
func (s *SimpleSyncScope) Delete(name string) {
96-
s.mutex.RLock()
96+
s.mutex.Lock()
9797
if delScope, ok := s.scope.(NeedsDelete); ok {
9898
delScope.Delete(name)
9999
}
100-
s.mutex.RUnlock()
100+
s.mutex.Unlock()
101101
}
102102

103103
// SetValue implements Scope.SetValue

0 commit comments

Comments
 (0)