summaryrefslogtreecommitdiff
path: root/src/lib/sync/mutex.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/sync/mutex.go')
-rw-r--r--src/lib/sync/mutex.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/sync/mutex.go b/src/lib/sync/mutex.go
index accf55a76..68db0b697 100644
--- a/src/lib/sync/mutex.go
+++ b/src/lib/sync/mutex.go
@@ -4,7 +4,9 @@
package sync
-package func cas(val *int32, old, new int32) bool
+func cas(val *int32, old, new int32) bool
+func semacquire(*int32)
+func semrelease(*int32)
export type Mutex struct {
key int32;
@@ -26,7 +28,7 @@ func (m *Mutex) Lock() {
// changed from 0 to 1; we hold lock
return;
}
- sys.semacquire(&m.sema);
+ semacquire(&m.sema);
}
func (m *Mutex) Unlock() {
@@ -34,6 +36,6 @@ func (m *Mutex) Unlock() {
// changed from 1 to 0; no contention
return;
}
- sys.semrelease(&m.sema);
+ semrelease(&m.sema);
}