mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02: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:
11
vendor/codeberg.org/gruf/go-mutexes/mutex_timeout.go
generated
vendored
11
vendor/codeberg.org/gruf/go-mutexes/mutex_timeout.go
generated
vendored
@ -97,7 +97,9 @@ func mutexTimeout(d time.Duration, unlock func(), fn func()) func() {
|
||||
// timerPool is the global &timer{} pool.
|
||||
var timerPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
return newtimer()
|
||||
t := time.NewTimer(time.Minute)
|
||||
t.Stop()
|
||||
return &timer{t: t, c: make(chan struct{})}
|
||||
},
|
||||
}
|
||||
|
||||
@ -107,13 +109,6 @@ type timer struct {
|
||||
c chan struct{}
|
||||
}
|
||||
|
||||
// newtimer returns a new timer instance.
|
||||
func newtimer() *timer {
|
||||
t := time.NewTimer(time.Minute)
|
||||
t.Stop()
|
||||
return &timer{t: t, c: make(chan struct{})}
|
||||
}
|
||||
|
||||
// Start will start the timer with duration 'd', performing 'fn' on timeout.
|
||||
func (t *timer) Start(d time.Duration, fn func()) {
|
||||
t.t.Reset(d)
|
||||
|
Reference in New Issue
Block a user