package locksutil
import "github.com/hashicorp/vault/sdk/helper/locksutil"
Index ¶
- Constants
- func LockIndexForKey(key string) uint8
- type DeadlockRWMutex
- func CreateLocksWithDeadlockDetection() []*DeadlockRWMutex
- func LockForKeyWithDeadLockDetection(locks []*DeadlockRWMutex, key string) *DeadlockRWMutex
- func LocksForKeysWithDeadLockDetection(locks []*DeadlockRWMutex, keys []string) []*DeadlockRWMutex
- type LockEntry
Constants ¶
const (
LockCount = 256
)
Functions ¶
func LockIndexForKey ¶
Types ¶
type DeadlockRWMutex ¶
type DeadlockRWMutex struct { deadlock.RWMutex }
DeadlockRWMutex is the RW version of DeadlockMutex.
func CreateLocksWithDeadlockDetection ¶
func CreateLocksWithDeadlockDetection() []*DeadlockRWMutex
func LockForKeyWithDeadLockDetection ¶
func LockForKeyWithDeadLockDetection(locks []*DeadlockRWMutex, key string) *DeadlockRWMutex
func LocksForKeysWithDeadLockDetection ¶
func LocksForKeysWithDeadLockDetection(locks []*DeadlockRWMutex, keys []string) []*DeadlockRWMutex
type LockEntry ¶
func CreateLocks ¶
func CreateLocks() []*LockEntry
CreateLocks returns an array so that the locks can be iterated over in order.
This is only threadsafe if a process is using a single lock, or iterating over the entire lock slice in order. Using a consistent order avoids deadlocks because you can never have the following:
Lock A, Lock B Lock B, Lock A
Where process 1 is now deadlocked trying to lock B, and process 2 deadlocked trying to lock A
func LockForKey ¶
func LocksForKeys ¶
Source Files ¶
- Version
- v0.18.0 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 1 month ago –
Tools for package owners.