From 400f58a0101717639dafea2f80740bbfb250573c Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Mon, 23 Mar 2015 23:13:11 -0400 Subject: [PATCH] runtime: don't trigger write barrier in newosproc for nacl This should fix the intermittent calling write barrier with mp.p == nil failures on the nacl/386 builder. Change-Id: I34aef5ca75ccd2939e6a6ad3f5dacec64903074e Signed-off-by: Shenghou Ma Reviewed-on: https://go-review.googlesource.com/7973 Reviewed-by: Austin Clements --- src/runtime/os1_nacl.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/os1_nacl.go b/src/runtime/os1_nacl.go index d47d2727f76..b3759c14081 100644 --- a/src/runtime/os1_nacl.go +++ b/src/runtime/os1_nacl.go @@ -67,11 +67,11 @@ func usleep(us uint32) { func mstart_nacl() +//go:nowritebarrier func newosproc(mp *m, stk unsafe.Pointer) { - tls := (*[3]unsafe.Pointer)(unsafe.Pointer(&mp.tls)) - tls[0] = unsafe.Pointer(mp.g0) - tls[1] = unsafe.Pointer(mp) - ret := nacl_thread_create(funcPC(mstart_nacl), stk, unsafe.Pointer(&tls[2]), nil) + mp.tls[0] = uintptr(unsafe.Pointer(mp.g0)) + mp.tls[1] = uintptr(unsafe.Pointer(mp)) + ret := nacl_thread_create(funcPC(mstart_nacl), stk, unsafe.Pointer(&mp.tls[2]), nil) if ret < 0 { print("nacl_thread_create: error ", -ret, "\n") throw("newosproc")