MCPcopy
hub / github.com/google/gvisor / testUnboundedLocks

Function testUnboundedLocks

tools/checklocks/test/branches.go:58–72  ·  view source on GitHub ↗
(tc []*oneGuardStruct)

Source from the content-addressed store, hash-verified

56}
57
58func 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}

Callers

nothing calls this directly

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…