Specify locking requirements with checklocks
ghananigans opened this issue · comments
checklocks simply checks for Lock/Unlock but doesn't distinguish between read/write locking requirements.
-
we may need write locks but checklocks passes with read locks (the following test is testing for wrong behaviour)
gvisor/tools/checklocks/test/basics.go
Lines 115 to 119 in 16b751b
-
A method may only need read OR write locks but checklocks does not yet support annotating it with that minimum requirement.
I think there was problem with the generated SSA where it was hard to distinguish this use-case. I will have to revisit this to refresh my memory why we did not support this.
I don't think this is difficult anymore. I can knock this out soon.
Also the test right above it has the wrong name - it writes rather than reads.
gvisor/tools/checklocks/test/basics.go
Lines 109 to 113 in 16b751b