diff options
| author | 2025-03-09 17:47:56 +0100 | |
|---|---|---|
| committer | 2025-12-01 22:08:04 +0100 | |
| commit | b1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch) | |
| tree | 9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/codeberg.org/gruf/go-mutexes/map_unsafe.go | |
| parent | [chore] update URLs to forked source (diff) | |
| download | gotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz | |
[chore] remove vendor
Diffstat (limited to 'vendor/codeberg.org/gruf/go-mutexes/map_unsafe.go')
| -rw-r--r-- | vendor/codeberg.org/gruf/go-mutexes/map_unsafe.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/vendor/codeberg.org/gruf/go-mutexes/map_unsafe.go b/vendor/codeberg.org/gruf/go-mutexes/map_unsafe.go deleted file mode 100644 index 829b2597f..000000000 --- a/vendor/codeberg.org/gruf/go-mutexes/map_unsafe.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.22 && !go1.26 - -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 { - _ 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) -} |
