1
This commit is contained in:
parent
5c996e016a
commit
6d58535a91
14
sysutils.go
14
sysutils.go
@ -335,6 +335,20 @@ func AdjustRangeValue[T int | int32 | int64 | float32 | float64](value T, minV T
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CreateCondTimer(ch chan int64, cond *sync.Cond) {
|
||||||
|
var waitSecond int64 = 10
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case waitSecond = <-ch:
|
||||||
|
if waitSecond < 10 {
|
||||||
|
waitSecond = 10
|
||||||
|
}
|
||||||
|
case <-time.After(time.Second * time.Duration(waitSecond)):
|
||||||
|
cond.Broadcast()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func IsDebug() bool {
|
func IsDebug() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user