mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 08:32:24 -05: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:
parent
8de928b5e9
commit
b8879ac68a
13 changed files with 639 additions and 268 deletions
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue