(tc []*oneGuardStruct)
| 56 | } |
| 57 | |
| 58 | func testUnboundedLocks(tc []*oneGuardStruct) { |
| 59 | for _, l := range tc { |
| 60 | l.mu.Lock() |
| 61 | } |
| 62 | // This test should have the above *not fail*, though the exact |
| 63 | // lock state cannot be tracked through the below. Therefore, we |
| 64 | // expect the next loop to actually fail, and we force the unlock |
| 65 | // loop to succeed in exactly the same way. |
| 66 | for _, l := range tc { |
| 67 | l.guardedField = 1 // +checklocksfail |
| 68 | } |
| 69 | for _, l := range tc { |
| 70 | l.mu.Unlock() // +checklocksforce |
| 71 | } |
| 72 | } |