mirror of
https://git.mirrors.martin98.com/https://github.com/ceph/ceph-csi.git
synced 2025-08-03 22:20:41 +08:00
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [github.com/hashicorp/vault/api](https://github.com/hashicorp/vault) from 1.1.1 to 1.2.0. - [Release notes](https://github.com/hashicorp/vault/releases) - [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/vault/compare/v1.1.1...v1.2.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/vault/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
44 lines
613 B
Go
44 lines
613 B
Go
package yamux
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
)
|
|
|
|
var (
|
|
timerPool = &sync.Pool{
|
|
New: func() interface{} {
|
|
timer := time.NewTimer(time.Hour * 1e6)
|
|
timer.Stop()
|
|
return timer
|
|
},
|
|
}
|
|
)
|
|
|
|
// asyncSendErr is used to try an async send of an error
|
|
func asyncSendErr(ch chan error, err error) {
|
|
if ch == nil {
|
|
return
|
|
}
|
|
select {
|
|
case ch <- err:
|
|
default:
|
|
}
|
|
}
|
|
|
|
// asyncNotify is used to signal a waiting goroutine
|
|
func asyncNotify(ch chan struct{}) {
|
|
select {
|
|
case ch <- struct{}{}:
|
|
default:
|
|
}
|
|
}
|
|
|
|
// min computes the minimum of two values
|
|
func min(a, b uint32) uint32 {
|
|
if a < b {
|
|
return a
|
|
}
|
|
return b
|
|
}
|