diff options
author | Russ Cox <rsc@golang.org> | 2014-11-11 17:08:33 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-11-11 17:08:33 -0500 |
commit | b2cdf30eb6c4a76504956aaaad47df969274296b (patch) | |
tree | c519fc491ccc78615ca3318574ad0168114223ed /src/runtime/lock_sema.go | |
parent | 59e3e5354d7fbb896022eb5bf57e8ad850c42dd1 (diff) | |
download | go-b2cdf30eb6c4a76504956aaaad47df969274296b.tar.gz go-b2cdf30eb6c4a76504956aaaad47df969274296b.zip |
[dev.cc] runtime: convert scheduler from C to Go
The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=r
R=r, daniel.morsing
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/172260043
Diffstat (limited to 'src/runtime/lock_sema.go')
-rw-r--r-- | src/runtime/lock_sema.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/runtime/lock_sema.go b/src/runtime/lock_sema.go index d136b82806..a2a87bac4d 100644 --- a/src/runtime/lock_sema.go +++ b/src/runtime/lock_sema.go @@ -31,10 +31,6 @@ const ( passive_spin = 1 ) -func semacreate() uintptr -func semasleep(int64) int32 -func semawakeup(mp *m) - func lock(l *mutex) { gp := getg() if gp.m.locks < 0 { @@ -263,8 +259,8 @@ func notetsleepg(n *note, ns int64) bool { if gp.m.waitsema == 0 { gp.m.waitsema = semacreate() } - entersyscallblock() + entersyscallblock(0) ok := notetsleep_internal(n, ns, nil, 0) - exitsyscall() + exitsyscall(0) return ok } |