Skip to content

Commit

Permalink
Revert "chore: fix potential race"
Browse files Browse the repository at this point in the history
This reverts commit ca9c557.
  • Loading branch information
andig committed Aug 18, 2024
1 parent 92bacbd commit 58148d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/config/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func (cp *handler[T]) Add(dev Device[T]) error {

// Delete deletes device
func (cp *handler[T]) Delete(name string) error {
cp.mu.Lock()
defer cp.mu.Unlock()
cp.mu.RLock()
defer cp.mu.RUnlock()

for i, dev := range cp.devices {
if name == dev.Config().Name {
Expand Down

0 comments on commit 58148d3

Please sign in to comment.