mirror of https://github.com/golang/go.git
runtime: explictly state lock ordering direction
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>
This commit is contained in:
parent
2ff1e3ebf5
commit
646b4ac065
|
|
@ -27,7 +27,8 @@ package runtime
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue