mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 02:31:19 +00:00
1774188a17
* fix analyzer * fix other deadlock Co-authored-by: Radosław Kapka <rkapka@wp.pl>
15 lines
506 B
Go
15 lines
506 B
Go
// These are all non recursive rlocks. Testing to make sure there are no false positives
|
|
package testdata
|
|
|
|
func (resource *ProtectResource) NestedRLockWithDefer() string {
|
|
resource.RLock()
|
|
defer resource.RUnlock()
|
|
return resource.GetResource() // want `found recursive read lock call`
|
|
}
|
|
|
|
func (resource *NestedProtectResource) NonNestedRLockDifferentRLocks() {
|
|
resource.RLock()
|
|
resource.GetNestedPResource() // get nested resource uses RLock, but at a deeper level in the struct
|
|
resource.RUnlock()
|
|
}
|