mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-03 18:57:47 +00:00
(broken state) WIP rewriting core to use ironwood
This commit is contained in:
@ -46,7 +46,7 @@ func TimerStop(t *time.Timer) bool {
|
||||
|
||||
// FuncTimeout runs the provided function in a separate goroutine, and returns true if the function finishes executing before the timeout passes, or false if the timeout passes.
|
||||
// It includes no mechanism to stop the function if the timeout fires, so the user is expected to do so on their own (such as with a Cancellation or a context).
|
||||
func FuncTimeout(f func(), timeout time.Duration) bool {
|
||||
func FuncTimeout(timeout time.Duration, f func()) bool {
|
||||
success := make(chan struct{})
|
||||
go func() {
|
||||
defer close(success)
|
||||
|
Reference in New Issue
Block a user