• Christos Zoulas's avatar
    runtime: make NetBSD lwp_park use monotonic time · 66fcf454
    Christos Zoulas authored
    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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    66fcf454
sys_netbsd_arm.s 8.69 KB