mirror of
https://github.com/golang/go
synced 2024-11-19 05:34: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:
parent
8537ccdd7f
commit
400f58a010
@ -67,11 +67,11 @@ func usleep(us uint32) {
|
|||||||
|
|
||||||
func mstart_nacl()
|
func mstart_nacl()
|
||||||
|
|
||||||
|
//go:nowritebarrier
|
||||||
func newosproc(mp *m, stk unsafe.Pointer) {
|
func newosproc(mp *m, stk unsafe.Pointer) {
|
||||||
tls := (*[3]unsafe.Pointer)(unsafe.Pointer(&mp.tls))
|
mp.tls[0] = uintptr(unsafe.Pointer(mp.g0))
|
||||||
tls[0] = unsafe.Pointer(mp.g0)
|
mp.tls[1] = uintptr(unsafe.Pointer(mp))
|
||||||
tls[1] = unsafe.Pointer(mp)
|
ret := nacl_thread_create(funcPC(mstart_nacl), stk, unsafe.Pointer(&mp.tls[2]), nil)
|
||||||
ret := nacl_thread_create(funcPC(mstart_nacl), stk, unsafe.Pointer(&tls[2]), nil)
|
|
||||||
if ret < 0 {
|
if ret < 0 {
|
||||||
print("nacl_thread_create: error ", -ret, "\n")
|
print("nacl_thread_create: error ", -ret, "\n")
|
||||||
throw("newosproc")
|
throw("newosproc")
|
||||||
|
Loading…
Reference in New Issue
Block a user