mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 13:42:24 -05:00
[dependencies] update go-store, go-mutexes (#422)
* update go-store, go-mutexes Signed-off-by: kim <grufwub@gmail.com> * update vendored code Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
8de928b5e9
commit
b8879ac68a
13 changed files with 639 additions and 268 deletions
16
vendor/codeberg.org/gruf/go-mutexes/mutex.go
generated
vendored
16
vendor/codeberg.org/gruf/go-mutexes/mutex.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue