]> Cypherpunks repositories - gostls13.git/commit
runtime: document memory ordering for h_spans
authorAustin Clements <austin@google.com>
Tue, 23 Jun 2015 18:04:09 +0000 (14:04 -0400)
committerAustin Clements <austin@google.com>
Tue, 23 Jun 2015 18:28:46 +0000 (18:28 +0000)
commiteabdd05892d7cf2d1e14a135367cf2445fa6c848
tree9bc991db7241acb19fd84ef5092460ef7d73d269
parentef4a17bc8030d7d800db76a7a57c4fb9dd2360ed
runtime: document memory ordering for h_spans

h_spans can be accessed concurrently without synchronization from
other threads, which means it needs the appropriate memory barriers on
weakly ordered machines. It happens to already have the necessary
memory barriers because all accesses to h_spans are currently
protected by the heap lock and the unlocks happen in exactly the
places where release barriers are needed, but it's easy to imagine
that this could change in the future. Document the fact that we're
depending on the barrier implied by the unlock.

Related to issue #9984.

Change-Id: I1bc3c95cd73361b041c8c95cd4bb92daf8c1f94a
Reviewed-on: https://go-review.googlesource.com/11361
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
src/runtime/mheap.go