mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 11:41:21 +00:00
0ea4b02b8b
* Added analyzer for detecting recursive/nested mutex read locks. * Added type assertion checks and removed unused 'iTypes' directory * Clean up * Bazel file fixes * Cleaned up code and added comments. Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
27 lines
651 B
Go
27 lines
651 B
Go
// recursive read lock calls with methods
|
|
package testdata
|
|
|
|
func (p *ProtectResource) NestedMethod() {
|
|
p.RLock()
|
|
p.GetResource() // want `found recursive read lock call`
|
|
p.RUnlock()
|
|
}
|
|
|
|
func (p *ProtectResource) NestedMethod2() {
|
|
p.RLock()
|
|
p.GetResourceNested() // want `found recursive read lock call`
|
|
p.RUnlock()
|
|
}
|
|
|
|
func (p *NestedProtectResource) MultiLevelStruct() {
|
|
p.nestedPR.RLock()
|
|
p.nestedPR.GetResource() // want `found recursive read lock call`
|
|
p.nestedPR.RUnlock()
|
|
}
|
|
|
|
func (p *NestedProtectResource) MultiLevelStruct2() {
|
|
p.nestedPR.RLock()
|
|
p.GetNestedPResource() // want `found recursive read lock call`
|
|
p.nestedPR.RUnlock()
|
|
}
|