Commit 85b74192 authored by Joel Sing's avatar Joel Sing Committed by Brad Fitzpatrick

runtime: fix semasleep() duration for openbsd

The timespec passed to thrsleep() needs to be an absolute/realtime
value, so add the current nanotime to ns.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5374048
parent 120f3b7b
......@@ -79,6 +79,7 @@ runtime·semasleep(int64 ns)
if(ns < 0)
runtime·thrsleep(&m->waitsemacount, 0, nil, &m->waitsemalock);
else {
ns += runtime·nanotime();
ts.tv_sec = ns/1000000000LL;
ts.tv_nsec = ns%1000000000LL;
runtime·thrsleep(&m->waitsemacount, CLOCK_REALTIME, &ts, &m->waitsemalock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment