mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 15:32:25 -05: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:
parent
2cc5d6269d
commit
4232d61782
5 changed files with 47 additions and 30 deletions
41
vendor/codeberg.org/gruf/go-mutexes/map_unsafe.go
generated
vendored
Normal file
41
vendor/codeberg.org/gruf/go-mutexes/map_unsafe.go
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
//go:build go1.22 && !go1.25
|
||||
|
||||
package mutexes
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// syncCond_last_ticket is an unsafe function that returns
|
||||
// the ticket of the last awoken / notified goroutine by a
|
||||
// a sync.Cond{}. it relies on expected memory layout.
|
||||
func syncCond_last_ticket(c *sync.Cond) uint32 {
|
||||
|
||||
// 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 {
|
||||
_ atomic.Uint32
|
||||
notify uint32
|
||||
// ... other fields
|
||||
}
|
||||
|
||||
// NOTE: must remain in
|
||||
// sync with sync.Cond{}.
|
||||
type syncCond struct {
|
||||
_ struct{}
|
||||
L sync.Locker
|
||||
n notifyList
|
||||
// ... other fields
|
||||
}
|
||||
|
||||
// This field must be atomcially accessed.
|
||||
cptr := (*syncCond)(unsafe.Pointer(c))
|
||||
return atomic.LoadUint32(&cptr.n.notify)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue