github.com/cilium/cilium@v1.16.2/pkg/lock/lock.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright Authors of Cilium 3 4 package lock 5 6 import ( 7 "github.com/sasha-s/go-deadlock" 8 ) 9 10 // RWMutex is equivalent to sync.RWMutex but applies deadlock detection if the 11 // built tag "lockdebug" is set 12 type RWMutex struct { 13 internalRWMutex 14 } 15 16 // Mutex is equivalent to sync.Mutex but applies deadlock detection if the 17 // built tag "lockdebug" is set 18 type Mutex struct { 19 internalMutex 20 } 21 22 // RWMutexDebug is a RWMutexDebug with deadlock detection regardless of use of the build tag 23 type RWMutexDebug struct { 24 deadlock.RWMutex 25 } 26 27 // MutexDebug is a MutexDebug with deadlock detection regardless of use of the build tag 28 type MutexDebug struct { 29 deadlock.Mutex 30 }