sync: RWMutex non-reentrant rlock -race check #35138
Labels
FeatureRequest
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?What did you do?
Misused RLock: https://play.golang.com/p/-7UFH11FDRV
What did you expect to see?
I want a
-race
mode to detect reentrant RLock calls even if deadlock is not yet happened.I want to propose to add this check to race detector. I am not familiar with how exactly race detector works. But it seems to me that it should be possible to save RLock/RUnlock calls for each goroutine in race mode, and when pattern (RLock,RLock,RUnlock,RUnlock) apear in the order of calls - it's a sign that RLock is misused.
Is it a good idea, to add a check for this?
The text was updated successfully, but these errors were encountered: