Skip to content

Commit

Permalink
sync: only use a lock in the Map implementation when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
aykevl authored and deadprogram committed Nov 22, 2024
1 parent 8d04821 commit 79164da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sync/map.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package sync

import "internal/task"

// This file implements just enough of sync.Map to get packages to compile. It
// is no more efficient than a map with a lock.

type Map struct {
lock Mutex
lock task.PMutex
m map[interface{}]interface{}
}

Expand Down

0 comments on commit 79164da

Please sign in to comment.