]> Cypherpunks repositories - gostls13.git/commit
runtime: make NetBSD lwp_park use monotonic time
authorChristos Zoulas <zoulasc@gmail.com>
Mon, 4 Dec 2017 01:48:45 +0000 (01:48 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 4 Dec 2017 03:29:56 +0000 (03:29 +0000)
commit66fcf45477b5f2ee4c39214911f417480cc55f5f
tree76d32815b20c4e84b49380cbf42f71eee886a49b
parent871b79316ad7f2b10f1347f8d9077713afaff451
runtime: make NetBSD lwp_park use monotonic time

This change updates runtime.semasleep to no longer call
runtime.nanotime and instead calls lwp_park with a duration to sleep
relative to the monotonic clock, so the nanotime is never called.
(This requires updating to a newer version of the lwp_park system
call, which is safe, because Go 1.10 will require the unreleased
NetBSD 8+ anyway)

Additionally, this change makes the nanotime function use the
monotonic clock for netbsd/arm, which was forgotten from
https://golang.org/cl/81135 which updated netbsd/amd64 and netbsd/386.

Because semasleep previously depended on nanotime, the past few days
of netbsd have likely been unstable because lwp_park was then mixing
the monotonic and wall clocks. After this CL, lwp_park no longer
depends on nanotime.

Original patch submitted at:
https://www.netbsd.org/~christos/go-lwp-park-clock-monotonic.diff

This commit message (any any mistakes therein) were written by Brad
Fitzpatrick. (Brad migrated the patch to Gerrit and checked CLAs)

Updates #6007
Fixes #22968

Also updates netbsd/arm to use monotonic time for

Change-Id: If77ef7dc610b3025831d84cdfadfbbba2c52acb2
Reviewed-on: https://go-review.googlesource.com/81715
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/os_netbsd.go
src/runtime/sys_netbsd_386.s
src/runtime/sys_netbsd_amd64.s
src/runtime/sys_netbsd_arm.s