1
0
mirror of https://github.com/golang/go synced 2024-11-19 17:04:41 -07:00

runtime: use UMTX_OP_WAIT_UINT on FreeBSD

UMTX_OP_WAIT expects that the address points to a uintptr, but
the code in lock_futex.c uses a uint32.  UMTX_OP_WAIT_UINT is
just like UMTX_OP_WAIT, but the address points to a uint32.
This almost certainly makes no difference on a little-endian
system, but since the kernel supports it we should do the
right thing.  And, who knows, maybe it matters.

R=golang-dev, bradfitz, r, ality
CC=golang-dev
https://golang.org/cl/8699043
This commit is contained in:
Ian Lance Taylor 2013-04-12 05:20:15 -07:00
parent 1d1142f178
commit 9fe8681df6
5 changed files with 9 additions and 9 deletions

View File

@ -45,8 +45,8 @@ const (
SA_RESTART = C.SA_RESTART
SA_ONSTACK = C.SA_ONSTACK
UMTX_OP_WAIT = C.UMTX_OP_WAIT
UMTX_OP_WAKE = C.UMTX_OP_WAKE
UMTX_OP_WAIT_UINT = C.UMTX_OP_WAIT_UINT
UMTX_OP_WAKE = C.UMTX_OP_WAKE
EINTR = C.EINTR

View File

@ -18,8 +18,8 @@ enum {
SA_RESTART = 0x2,
SA_ONSTACK = 0x1,
UMTX_OP_WAIT = 0x2,
UMTX_OP_WAKE = 0x3,
UMTX_OP_WAIT_UINT = 0xb,
UMTX_OP_WAKE = 0x3,
EINTR = 0x4,

View File

@ -18,8 +18,8 @@ enum {
SA_RESTART = 0x2,
SA_ONSTACK = 0x1,
UMTX_OP_WAIT = 0x2,
UMTX_OP_WAKE = 0x3,
UMTX_OP_WAIT_UINT = 0xb,
UMTX_OP_WAKE = 0x3,
EINTR = 0x4,

View File

@ -18,8 +18,8 @@ enum {
SA_RESTART = 0x2,
SA_ONSTACK = 0x1,
UMTX_OP_WAIT = 0x2,
UMTX_OP_WAKE = 0x3,
UMTX_OP_WAIT_UINT = 0xb,
UMTX_OP_WAKE = 0x3,
EINTR = 0x4,

View File

@ -60,7 +60,7 @@ runtime·futexsleep(uint32 *addr, uint32 val, int64 ns)
tsp = &ts;
}
ret = runtime·sys_umtx_op(addr, UMTX_OP_WAIT, val, nil, tsp);
ret = runtime·sys_umtx_op(addr, UMTX_OP_WAIT_UINT, val, nil, tsp);
if(ret >= 0 || ret == -EINTR)
return;