aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-10-28 16:02:14 +0100
committerRon Evans <[email protected]>2024-11-22 09:42:39 +0100
commit79164dae71d5af32d316a5fc1dc5c996f04cc0f1 (patch)
treea3b990d01d42f67b4feed42df08a3b9b9ebf4796
parent8d048216392c17a13833f621f3c9760dc302ff36 (diff)
downloadtinygo-79164dae71d5af32d316a5fc1dc5c996f04cc0f1.tar.gz
tinygo-79164dae71d5af32d316a5fc1dc5c996f04cc0f1.zip
sync: only use a lock in the Map implementation when needed
-rw-r--r--src/sync/map.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sync/map.go b/src/sync/map.go
index f27450ce5..cd8a1967d 100644
--- a/src/sync/map.go
+++ b/src/sync/map.go
@@ -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{}
}