summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-mutexes/mutex.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/codeberg.org/gruf/go-mutexes/mutex.go')
-rw-r--r--vendor/codeberg.org/gruf/go-mutexes/mutex.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/codeberg.org/gruf/go-mutexes/mutex.go b/vendor/codeberg.org/gruf/go-mutexes/mutex.go
index c4f3f8876..3841c9423 100644
--- a/vendor/codeberg.org/gruf/go-mutexes/mutex.go
+++ b/vendor/codeberg.org/gruf/go-mutexes/mutex.go
@@ -41,24 +41,24 @@ func WithFuncRW(mu RWMutex, onLock, onRLock, onUnlock, onRUnlock func()) RWMutex
}
// baseMutex simply wraps a sync.Mutex to implement our Mutex interface
-type baseMutex struct{ mu sync.Mutex }
+type baseMutex sync.Mutex
func (mu *baseMutex) Lock() func() {
- mu.mu.Lock()
- return mu.mu.Unlock
+ (*sync.Mutex)(mu).Lock()
+ return (*sync.Mutex)(mu).Unlock
}
// baseRWMutex simply wraps a sync.RWMutex to implement our RWMutex interface
-type baseRWMutex struct{ mu sync.RWMutex }
+type baseRWMutex sync.RWMutex
func (mu *baseRWMutex) Lock() func() {
- mu.mu.Lock()
- return mu.mu.Unlock
+ (*sync.RWMutex)(mu).Lock()
+ return (*sync.RWMutex)(mu).Unlock
}
func (mu *baseRWMutex) RLock() func() {
- mu.mu.RLock()
- return mu.mu.RUnlock
+ (*sync.RWMutex)(mu).RLock()
+ return (*sync.RWMutex)(mu).RUnlock
}
// fnMutex wraps a Mutex to add hooks for Lock and Unlock