1
0
mirror of https://github.com/golang/go synced 2024-11-19 03:24:40 -07:00

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 <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7973
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Shenghou Ma 2015-03-23 23:13:11 -04:00 committed by Minux Ma
parent 8537ccdd7f
commit 400f58a010

View File

@ -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")