• Austin Clements's avatar
    runtime: make "write barriers are not allowed" comments more precise · 9e6f7aac
    Austin Clements authored
    Currently, various functions are marked with the comment
    
      // May run without a P, so write barriers are not allowed.
    
    However, "running without a P" is ambiguous. We intended these to mean
    that m.p may be nil (which is the condition checked by the write
    barrier). The comment could also be taken to mean that a
    stop-the-world may happen, which is not the case for these functions
    because they run in situations where there is in fact a function on
    the stack holding a P locally, it just isn't in m.p.
    
    Change these comments to state precisely what we mean, that m.p may be
    nil.
    
    Change-Id: I4a4a1d26aebd455e5067540e13b9f96a7482146c
    Reviewed-on: https://go-review.googlesource.com/8209Reviewed-by: 's avatarMinux Ma <minux@golang.org>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    9e6f7aac
os1_netbsd.go 4.44 KB