Home | History | Annotate | Download | only in testdata

Lines Matching refs:sync

10 import "sync"
12 func OkFunc(*sync.Mutex) {}
13 func BadFunc(sync.Mutex) {} // ERROR "BadFunc passes lock by value: sync.Mutex"
14 func BadFunc2(sync.Map) {} // ERROR "BadFunc2 passes lock by value: sync.Map contains sync.Mutex"
15 func OkRet() *sync.Mutex {}
16 func BadRet() sync.Mutex {} // Don't warn about results
19 OkClosure = func(*sync.Mutex) {}
20 BadClosure = func(sync.Mutex) {} // ERROR "func passes lock by value: sync.Mutex"
21 BadClosure2 = func(sync.Map) {} // ERROR "func passes lock by value: sync.Map contains sync.Mutex"
25 sync.RWMutex
36 s sync.Mutex
40 func (FieldMutex) BadMeth() {} // ERROR "BadMeth passes lock by value: testdata.FieldMutex contains sync.Mutex"
42 func BadFunc(FieldMutex, int) {} // ERROR "BadFunc passes lock by value: testdata.FieldMutex contains sync.Mutex"
53 sync.Mutex
60 s *sync.Mutex // safe to copy this pointer
69 sync.Locker // safe to copy interface values
85 var m sync.Mutex
86 var t struct{ lock sync.Mutex }
90 f(3, &sync.Mutex{})
91 f(4, m) // ERROR "call of f copies lock value: sync.Mutex"
92 f(5, t) // ERROR "call of f copies lock value: struct.lock sync.Mutex. contains sync.Mutex"
94 fntab[0](t) // ERROR "call of fntab.0. copies lock value: struct.lock sync.Mutex. contains sync.Mutex"
99 var m sync.Mutex
100 var t struct{ lock sync.Mutex }
106 return 1, &sync.Mutex{}
108 return 2, m // ERROR "return copies lock value: sync.Mutex"
110 return 3, t // ERROR "return copies lock value: struct.lock sync.Mutex. contains sync.Mutex"
125 // Since we're looking for Lock methods, sync.Once's underlying
126 // sync.Mutex gets called out, but without any reference to the sync.Once.
127 type LocalOnce sync.Once
129 func (LocalOnce) Bad() {} // ERROR "Bad passes lock by value: testdata.LocalOnce contains sync.Mutex"
134 type LocalMutex sync.Mutex