aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/Microsoft/hcsshim/waithelper.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-01-08 14:52:57 +0100
committerValentin Rothberg <rothberg@redhat.com>2019-01-11 13:38:11 +0100
commitbd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87 (patch)
tree5f06e4e289f16d9164d692590a3fe6541b5384cf /vendor/github.com/Microsoft/hcsshim/waithelper.go
parent545f24421247c9f6251a634764db3f8f8070a812 (diff)
downloadpodman-bd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87.tar.gz
podman-bd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87.tar.bz2
podman-bd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87.zip
vendor: update everything
* If possible, update each dependency to the latest available version. * Use releases over commit IDs and avoid vendoring branches. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/Microsoft/hcsshim/waithelper.go')
-rw-r--r--vendor/github.com/Microsoft/hcsshim/waithelper.go63
1 files changed, 0 insertions, 63 deletions
diff --git a/vendor/github.com/Microsoft/hcsshim/waithelper.go b/vendor/github.com/Microsoft/hcsshim/waithelper.go
deleted file mode 100644
index b7be20ea0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/waithelper.go
+++ /dev/null
@@ -1,63 +0,0 @@
-package hcsshim
-
-import (
- "time"
-
- "github.com/sirupsen/logrus"
-)
-
-func processAsyncHcsResult(err error, resultp *uint16, callbackNumber uintptr, expectedNotification hcsNotification, timeout *time.Duration) error {
- err = processHcsResult(err, resultp)
- if IsPending(err) {
- return waitForNotification(callbackNumber, expectedNotification, timeout)
- }
-
- return err
-}
-
-func waitForNotification(callbackNumber uintptr, expectedNotification hcsNotification, timeout *time.Duration) error {
- callbackMapLock.RLock()
- channels := callbackMap[callbackNumber].channels
- callbackMapLock.RUnlock()
-
- expectedChannel := channels[expectedNotification]
- if expectedChannel == nil {
- logrus.Errorf("unknown notification type in waitForNotification %x", expectedNotification)
- return ErrInvalidNotificationType
- }
-
- var c <-chan time.Time
- if timeout != nil {
- timer := time.NewTimer(*timeout)
- c = timer.C
- defer timer.Stop()
- }
-
- select {
- case err, ok := <-expectedChannel:
- if !ok {
- return ErrHandleClose
- }
- return err
- case err, ok := <-channels[hcsNotificationSystemExited]:
- if !ok {
- return ErrHandleClose
- }
- // If the expected notification is hcsNotificationSystemExited which of the two selects
- // chosen is random. Return the raw error if hcsNotificationSystemExited is expected
- if channels[hcsNotificationSystemExited] == expectedChannel {
- return err
- }
- return ErrUnexpectedContainerExit
- case _, ok := <-channels[hcsNotificationServiceDisconnect]:
- if !ok {
- return ErrHandleClose
- }
- // hcsNotificationServiceDisconnect should never be an expected notification
- // it does not need the same handling as hcsNotificationSystemExited
- return ErrUnexpectedProcessAbort
- case <-c:
- return ErrTimeout
- }
- return nil
-}