runtime: rename Lock to Mutex
Mutex is consistent with package sync, and when in the
unexported Go form it avoids having a conflcit between
the type (now mutex) and the function (lock).
LGTM=iant
R=golang-codereviews, iant
CC=dvyukov, golang-codereviews, r
https://golang.org/cl/133140043
diff --git a/src/pkg/runtime/iface.go b/src/pkg/runtime/iface.go
index 1421efe..a317628 100644
--- a/src/pkg/runtime/iface.go
+++ b/src/pkg/runtime/iface.go
@@ -13,7 +13,7 @@
)
var (
- ifaceLock lock // lock for accessing hash
+ ifaceLock mutex // lock for accessing hash
hash [hashSize]*itab
)
@@ -51,7 +51,7 @@
var locked int
for locked = 0; locked < 2; locked++ {
if locked != 0 {
- golock(&ifaceLock)
+ lock(&ifaceLock)
}
for m = (*itab)(atomicloadp(unsafe.Pointer(&hash[h]))); m != nil; m = m.link {
if m.inter == inter && m._type == typ {
@@ -69,7 +69,7 @@
}
}
if locked != 0 {
- gounlock(&ifaceLock)
+ unlock(&ifaceLock)
}
return m
}
@@ -106,7 +106,7 @@
// didn't find method
if !canfail {
if locked != 0 {
- gounlock(&ifaceLock)
+ unlock(&ifaceLock)
}
panic(&TypeAssertionError{"", *typ._string, *inter.typ._string, *iname})
}
@@ -119,7 +119,7 @@
}
m.link = hash[h]
atomicstorep(unsafe.Pointer(&hash[h]), unsafe.Pointer(m))
- gounlock(&ifaceLock)
+ unlock(&ifaceLock)
if m.bad != 0 {
return nil
}