From: Michael Pratt Date: Fri, 17 Apr 2020 19:25:03 +0000 (-0400) Subject: runtime: explictly state lock ordering direction X-Git-Tag: go1.15beta1~518 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=646b4ac06583396bb296f9b3f855fdab4ebe0060;p=gostls13.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 --- diff --git a/src/runtime/lockrank.go b/src/runtime/lockrank.go index 4b7273aa5f..784f4236f4 100644 --- a/src/runtime/lockrank.go +++ b/src/runtime/lockrank.go @@ -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