mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 11:03:53 +00:00
17 lines
206 B
Go
17 lines
206 B
Go
//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
|
|
}
|