summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-mutexes/cond.go
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2025-03-09 17:47:56 +0100
committerLibravatar Terin Stock <terinjokes@gmail.com>2025-12-01 22:08:04 +0100
commitb1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch)
tree9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/codeberg.org/gruf/go-mutexes/cond.go
parent[chore] update URLs to forked source (diff)
downloadgotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz
[chore] remove vendor
Diffstat (limited to 'vendor/codeberg.org/gruf/go-mutexes/cond.go')
-rw-r--r--vendor/codeberg.org/gruf/go-mutexes/cond.go67
1 files changed, 0 insertions, 67 deletions
diff --git a/vendor/codeberg.org/gruf/go-mutexes/cond.go b/vendor/codeberg.org/gruf/go-mutexes/cond.go
deleted file mode 100644
index 3d7f21126..000000000
--- a/vendor/codeberg.org/gruf/go-mutexes/cond.go
+++ /dev/null
@@ -1,67 +0,0 @@
-package mutexes
-
-import (
- "sync"
-)
-
-// Cond is similar to a sync.Cond{}, but
-// it encompasses the Mutex{} within itself.
-type Cond struct {
- c sync.Cond
- sync.Mutex
-}
-
-// See: sync.Cond{}.Wait().
-func (c *Cond) Wait() {
- if c.c.L == nil {
- c.c.L = &c.Mutex
- }
- c.c.Wait()
-}
-
-// See: sync.Cond{}.Signal().
-func (c *Cond) Signal() {
- if c.c.L == nil {
- c.c.L = &c.Mutex
- }
- c.c.Signal()
-}
-
-// See: sync.Cond{}.Broadcast().
-func (c *Cond) Broadcast() {
- if c.c.L == nil {
- c.c.L = &c.Mutex
- }
- c.c.Broadcast()
-}
-
-// RWCond is similar to a sync.Cond{}, but
-// it encompasses the RWMutex{} within itself.
-type RWCond struct {
- c sync.Cond
- sync.RWMutex
-}
-
-// See: sync.Cond{}.Wait().
-func (c *RWCond) Wait() {
- if c.c.L == nil {
- c.c.L = &c.RWMutex
- }
- c.c.Wait()
-}
-
-// See: sync.Cond{}.Signal().
-func (c *RWCond) Signal() {
- if c.c.L == nil {
- c.c.L = &c.RWMutex
- }
- c.c.Signal()
-}
-
-// See: sync.Cond{}.Broadcast().
-func (c *RWCond) Broadcast() {
- if c.c.L == nil {
- c.c.L = &c.RWMutex
- }
- c.c.Broadcast()
-}