runtime: rename gothrow to throw
Rename "gothrow" to "throw" now that the C version of "throw"
is no longer needed.
This change is purely mechanical except in panic.go where the
old version of "throw" has been deleted.
sed -i "" 's/[[:<:]]gothrow[[:>:]]/throw/g' runtime/*.go
Change-Id: Icf0752299c35958b92870a97111c67bcd9159dc3
Reviewed-on: https://go-review.googlesource.com/2150
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
diff --git a/src/runtime/lock_sema.go b/src/runtime/lock_sema.go
index a2a87ba..c995e08 100644
--- a/src/runtime/lock_sema.go
+++ b/src/runtime/lock_sema.go
@@ -34,7 +34,7 @@
func lock(l *mutex) {
gp := getg()
if gp.m.locks < 0 {
- gothrow("runtime·lock: lock count")
+ throw("runtime·lock: lock count")
}
gp.m.locks++
@@ -112,7 +112,7 @@
}
gp.m.locks--
if gp.m.locks < 0 {
- gothrow("runtime·unlock: lock count")
+ throw("runtime·unlock: lock count")
}
if gp.m.locks == 0 && gp.preempt { // restore the preemption request in case we've cleared it in newstack
gp.stackguard0 = stackPreempt
@@ -140,7 +140,7 @@
// Nothing was waiting. Done.
case v == locked:
// Two notewakeups! Not allowed.
- gothrow("notewakeup - double wakeup")
+ throw("notewakeup - double wakeup")
default:
// Must be the waiting m. Wake it up.
semawakeup((*m)(unsafe.Pointer(v)))
@@ -150,7 +150,7 @@
func notesleep(n *note) {
gp := getg()
if gp != gp.m.g0 {
- gothrow("notesleep not on g0")
+ throw("notesleep not on g0")
}
if gp.m.waitsema == 0 {
gp.m.waitsema = semacreate()
@@ -158,7 +158,7 @@
if !casuintptr(&n.key, 0, uintptr(unsafe.Pointer(gp.m))) {
// Must be locked (got wakeup).
if n.key != locked {
- gothrow("notesleep - waitm out of sync")
+ throw("notesleep - waitm out of sync")
}
return
}
@@ -180,7 +180,7 @@
if !casuintptr(&n.key, 0, uintptr(unsafe.Pointer(gp.m))) {
// Must be locked (got wakeup).
if n.key != locked {
- gothrow("notetsleep - waitm out of sync")
+ throw("notetsleep - waitm out of sync")
}
return true
}
@@ -228,12 +228,12 @@
// Grab it to avoid getting out of sync.
gp.m.blocked = true
if semasleep(-1) < 0 {
- gothrow("runtime: unable to acquire - semaphore out of sync")
+ throw("runtime: unable to acquire - semaphore out of sync")
}
gp.m.blocked = false
return true
default:
- gothrow("runtime: unexpected waitm - semaphore out of sync")
+ throw("runtime: unexpected waitm - semaphore out of sync")
}
}
}
@@ -241,7 +241,7 @@
func notetsleep(n *note, ns int64) bool {
gp := getg()
if gp != gp.m.g0 && gp.m.gcing == 0 {
- gothrow("notetsleep not on g0")
+ throw("notetsleep not on g0")
}
if gp.m.waitsema == 0 {
gp.m.waitsema = semacreate()
@@ -254,7 +254,7 @@
func notetsleepg(n *note, ns int64) bool {
gp := getg()
if gp == gp.m.g0 {
- gothrow("notetsleepg on g0")
+ throw("notetsleepg on g0")
}
if gp.m.waitsema == 0 {
gp.m.waitsema = semacreate()