aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/netpoll.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-12-27 20:58:00 -0800
committerKeith Randall <khr@golang.org>2014-12-28 06:16:16 +0000
commitb2a950bb7343a46ff3edd8502fe2f02fc051a308 (patch)
tree97511001e7aa590d22b1b0d8c962467319180681 /src/runtime/netpoll.go
parentddef2d27fec52c271ee72911e60b07f5f62cf3cb (diff)
downloadgo-b2a950bb7343a46ff3edd8502fe2f02fc051a308.tar.gz
go-b2a950bb7343a46ff3edd8502fe2f02fc051a308.zip
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>
Diffstat (limited to 'src/runtime/netpoll.go')
-rw-r--r--src/runtime/netpoll.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/runtime/netpoll.go b/src/runtime/netpoll.go
index ba7a0f6931..0bd372319a 100644
--- a/src/runtime/netpoll.go
+++ b/src/runtime/netpoll.go
@@ -81,10 +81,10 @@ func net_runtime_pollOpen(fd uintptr) (*pollDesc, int) {
pd := pollcache.alloc()
lock(&pd.lock)
if pd.wg != 0 && pd.wg != pdReady {
- gothrow("netpollOpen: blocked write on free descriptor")
+ throw("netpollOpen: blocked write on free descriptor")
}
if pd.rg != 0 && pd.rg != pdReady {
- gothrow("netpollOpen: blocked read on free descriptor")
+ throw("netpollOpen: blocked read on free descriptor")
}
pd.fd = fd
pd.closing = false
@@ -103,13 +103,13 @@ func net_runtime_pollOpen(fd uintptr) (*pollDesc, int) {
//go:linkname net_runtime_pollClose net.runtime_pollClose
func net_runtime_pollClose(pd *pollDesc) {
if !pd.closing {
- gothrow("netpollClose: close w/o unblock")
+ throw("netpollClose: close w/o unblock")
}
if pd.wg != 0 && pd.wg != pdReady {
- gothrow("netpollClose: blocked write on closing descriptor")
+ throw("netpollClose: blocked write on closing descriptor")
}
if pd.rg != 0 && pd.rg != pdReady {
- gothrow("netpollClose: blocked read on closing descriptor")
+ throw("netpollClose: blocked read on closing descriptor")
}
netpollclose(uintptr(pd.fd))
pollcache.free(pd)
@@ -240,7 +240,7 @@ func net_runtime_pollSetDeadline(pd *pollDesc, d int64, mode int) {
func net_runtime_pollUnblock(pd *pollDesc) {
lock(&pd.lock)
if pd.closing {
- gothrow("netpollUnblock: already closing")
+ throw("netpollUnblock: already closing")
}
pd.closing = true
pd.seq++
@@ -314,7 +314,7 @@ func netpollblock(pd *pollDesc, mode int32, waitio bool) bool {
return true
}
if old != 0 {
- gothrow("netpollblock: double wait")
+ throw("netpollblock: double wait")
}
if casuintptr(gpp, 0, pdWait) {
break
@@ -330,7 +330,7 @@ func netpollblock(pd *pollDesc, mode int32, waitio bool) bool {
// be careful to not lose concurrent READY notification
old := xchguintptr(gpp, 0)
if old > pdWait {
- gothrow("netpollblock: corrupted state")
+ throw("netpollblock: corrupted state")
}
return old == pdReady
}
@@ -376,7 +376,7 @@ func netpolldeadlineimpl(pd *pollDesc, seq uintptr, read, write bool) {
var rg *g
if read {
if pd.rd <= 0 || pd.rt.f == nil {
- gothrow("netpolldeadlineimpl: inconsistent read deadline")
+ throw("netpolldeadlineimpl: inconsistent read deadline")
}
pd.rd = -1
atomicstorep(unsafe.Pointer(&pd.rt.f), nil) // full memory barrier between store to rd and load of rg in netpollunblock
@@ -385,7 +385,7 @@ func netpolldeadlineimpl(pd *pollDesc, seq uintptr, read, write bool) {
var wg *g
if write {
if pd.wd <= 0 || pd.wt.f == nil && !read {
- gothrow("netpolldeadlineimpl: inconsistent write deadline")
+ throw("netpolldeadlineimpl: inconsistent write deadline")
}
pd.wd = -1
atomicstorep(unsafe.Pointer(&pd.wt.f), nil) // full memory barrier between store to wd and load of wg in netpollunblock