At least as far as I can tell, this file never explicitly states whether
locks with higher or lower rank should be taken first. It is implied in
some comments, and clear from the code, of course.
Add an explicit comment to make things more clear and hopefully reduce
new locks being adding in the wrong spot.
Change-Id: I17c6fd5fc216954e5f3550cf91f17e25139f1587
Reviewed-on: https://go-review.googlesource.com/c/go/+/228785
Reviewed-by: Dan Scales <danscales@google.com>
type lockRank int
// Constants representing the lock rank of the architecture-independent locks in
-// the runtime.
+// the runtime. Locks with lower rank must be taken before locks with higher
+// rank.
const (
lockRankDummy lockRank = iota