Commit 721716ca authored by Cherry Zhang's avatar Cherry Zhang
Browse files

[dev.link] cmd/link: set attributes atomically

Now concurrent relocsym may access symbols attributes
concurrently, causing data race when using the race detector. I
think it is still safe as we read/write on different bits, and
not write the same symbol's attributes from multiple goroutines,
so it will always reads the right value regardless whether the
write happens before or after, as long as the memory model is not
so insane.

Use atomic accesses to appease the race detector. It doesn't seem
to cost much, at least on x86.

Change-Id: I2bfc3755ee59c87ed237d508f29d6172fa976392
Reviewed-on: https://go-review.googlesource.com/c/go/+/226368


Reviewed-by: default avatarAustin Clements <austin@google.com>
parent 6506cf19
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment