mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore]: Bump codeberg.org/gruf/go-mutexes from 1.5.1 to 1.5.2 (#3976)
Bumps codeberg.org/gruf/go-mutexes from 1.5.1 to 1.5.2. --- updated-dependencies: - dependency-name: codeberg.org/gruf/go-mutexes dependency-version: 1.5.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
28
vendor/codeberg.org/gruf/go-mutexes/map.go
generated
vendored
28
vendor/codeberg.org/gruf/go-mutexes/map.go
generated
vendored
@@ -2,7 +2,6 @@ package mutexes
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"unsafe"
|
||||
|
||||
"codeberg.org/gruf/go-mempool"
|
||||
@@ -185,34 +184,11 @@ func (mu *rwmutex) Unlock() bool {
|
||||
// Fully unlocked.
|
||||
mu.t = 0
|
||||
|
||||
// NOTE: must remain in
|
||||
// sync with runtime.notifyList{}.
|
||||
//
|
||||
// goexperiment.staticlockranking
|
||||
// does change it slightly, but
|
||||
// this does not alter the first
|
||||
// 2 fields which are all we need.
|
||||
type notifyList struct {
|
||||
_ uint32
|
||||
notify uint32
|
||||
// ... other fields
|
||||
}
|
||||
|
||||
// NOTE: must remain in
|
||||
// sync with sync.Cond{}.
|
||||
type syncCond struct {
|
||||
_ struct{}
|
||||
L sync.Locker
|
||||
n notifyList
|
||||
// ... other fields
|
||||
}
|
||||
|
||||
// Awake all blocked goroutines and check
|
||||
// for change in the last notified ticket.
|
||||
cptr := (*syncCond)(unsafe.Pointer(&mu.c))
|
||||
before := atomic.LoadUint32(&cptr.n.notify)
|
||||
before := syncCond_last_ticket(&mu.c)
|
||||
mu.c.Broadcast() // awakes all blocked!
|
||||
after := atomic.LoadUint32(&cptr.n.notify)
|
||||
after := syncCond_last_ticket(&mu.c)
|
||||
|
||||
// If ticket changed, this indicates
|
||||
// AT LEAST one goroutine was awoken.
|
||||
|
Reference in New Issue
Block a user