According to https://github.com/golang/go/blob/7a6ccece877232fc58872c85fdf0718629b83d91/src/cmd/compile/internal/gc/racewalk.go#L45-L47 , the compile does not insert data race detecting code in package "sync".
在 2018年8月22日星期三 UTC+8下午6:25:24,nea...@gmail.com写道: > > Hi, > > When I copy the sync.Pool's source code in a repo, and using ` > //go:linkname` link those runtime functions manually. > When I run `go test -race`, it reports `DATA RACE`. > But the sync.Pool with the same test case does not report `DATA RACE`. > > Does runtime.RaceDisable not work in non-std library ? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.