summaryrefslogtreecommitdiff
path: root/src/pkg/sync/mutex.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/sync/mutex.go')
-rw-r--r--src/pkg/sync/mutex.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/pkg/sync/mutex.go b/src/pkg/sync/mutex.go
index 4fc02743c..9494cc3f8 100644
--- a/src/pkg/sync/mutex.go
+++ b/src/pkg/sync/mutex.go
@@ -10,10 +10,7 @@
// Values containing the types defined in this package should not be copied.
package sync
-import (
- "runtime"
- "sync/atomic"
-)
+import "sync/atomic"
// A Mutex is a mutual exclusion lock.
// Mutexes can be created as part of other structures;
@@ -60,7 +57,7 @@ func (m *Mutex) Lock() {
if old&mutexLocked == 0 {
break
}
- runtime.Semacquire(&m.sema)
+ runtime_Semacquire(&m.sema)
awoke = true
}
}
@@ -89,7 +86,7 @@ func (m *Mutex) Unlock() {
// Grab the right to wake someone.
new = (old - 1<<mutexWaiterShift) | mutexWoken
if atomic.CompareAndSwapInt32(&m.state, old, new) {
- runtime.Semrelease(&m.sema)
+ runtime_Semrelease(&m.sema)
return
}
old = m.state