aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/lock_futex.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/lock_futex.go')
-rw-r--r--libgo/go/runtime/lock_futex.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/libgo/go/runtime/lock_futex.go b/libgo/go/runtime/lock_futex.go
index f672efd..21d7e0d 100644
--- a/libgo/go/runtime/lock_futex.go
+++ b/libgo/go/runtime/lock_futex.go
@@ -55,6 +55,10 @@ func key32(p *uintptr) *uint32 {
}
func lock(l *mutex) {
+ lockWithRank(l, getLockRank(l))
+}
+
+func lock2(l *mutex) {
gp := getg()
if gp.m.locks < 0 {
@@ -115,6 +119,10 @@ func lock(l *mutex) {
}
func unlock(l *mutex) {
+ unlockWithRank(l)
+}
+
+func unlock2(l *mutex) {
v := atomic.Xchg(key32(&l.key), mutex_unlocked)
if v == mutex_unlocked {
throw("unlock of unlocked lock")
@@ -241,8 +249,8 @@ func notetsleepg(n *note, ns int64) bool {
return ok
}
-func beforeIdle(int64) bool {
- return false
+func beforeIdle(int64) (*g, bool) {
+ return nil, false
}
func checkTimeouts() {}