bbgo_origin/pkg/util/trylock.go

17 lines
206 B
Go
Raw Permalink Normal View History

//go:build !go1.18
// +build !go1.18
package util
import "sync"
func TryLock(lock *sync.RWMutex) bool {
lock.Lock()
return true
}
func TryRLock(lock *sync.RWMutex) bool {
lock.RLock()
return true
}