File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed
Expand file tree Collapse file tree 3 files changed +5
-0
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 @@ -22,6 +22,7 @@ func testInconsistentReturn(tc *oneGuardStruct) { // +checklocksfail
2222 if x := rand .Intn (10 ); x % 2 == 1 {
2323 tc .mu .Lock ()
2424 }
25+ return
2526}
2627
2728func testConsistentBranching (tc * oneGuardStruct ) {
@@ -53,6 +54,7 @@ func testInconsistentBranching(tc *oneGuardStruct) { // +checklocksfail:2
5354 if x % 2 == 1 {
5455 tc .mu .Unlock () // +checklocksforce
5556 }
57+ return
5658}
5759
5860func testUnboundedLocks (tc []* oneGuardStruct ) {
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