File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed
Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -688,6 +688,7 @@ func (e *Endpoint) LockUser() {
688688 // Finally just give up and wait for the Lock.
689689 e .mu .Lock ()
690690 e .ownedByUser .Store (1 )
691+ return // +checklocksforce: this locks e.snd.ep.mu
691692}
692693
693694// UnlockUser will check if there are any segments already queued for processing
@@ -753,6 +754,7 @@ func (e *Endpoint) AssertLockHeld(locked *Endpoint) {
753754 if e != locked {
754755 panic ("AssertLockHeld failed: locked endpoint != asserting endpoint" )
755756 }
757+ return // +checklocksforce
756758}
757759
758760// TryLock is a helper that calls TryLock on the endpoint's mutex and
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import (
1818 "math/rand"
1919)
2020
21- func testInconsistentReturn (tc * oneGuardStruct ) { // +checklocksfail
21+ func testInconsistentReturn (tc * oneGuardStruct ) { // +checklocksfail:2
2222 if x := rand .Intn (10 ); x % 2 == 1 {
2323 tc .mu .Lock ()
2424 }
@@ -39,7 +39,7 @@ func testConsistentBranching(tc *oneGuardStruct) {
3939 }
4040}
4141
42- func testInconsistentBranching (tc * oneGuardStruct ) { // +checklocksfail:2
42+ func testInconsistentBranching (tc * oneGuardStruct ) { // +checklocksfail:3
4343 // We traverse the control flow graph in all consistent ways. We cannot
4444 // determine however, that the first if block and second if block will
4545 // evaluate to the same condition. Therefore, there are two consistent
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ func standaloneFunctionWithGuard(a *testMethodsWithParameters) {
9696 a .guardedField = 1
9797 a .mu .Unlock ()
9898 a .guardedField = 1 // +checklocksfail
99+ return // +checklocksfail
99100}
100101
101102type testMethodsWithEmbedded struct {
You can’t perform that action at this time.
0 commit comments