// Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. package vmimpl import ( "time" ) // Sleep for d. // If shutdown is in progress, return false prematurely. func SleepInterruptible(d time.Duration) bool { select { case <-time.After(d): return true case <-Shutdown: return false } }