summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/context.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-11-01 01:07:14 +0000
committergVisor bot <gvisor-bot@google.com>2019-11-01 01:07:14 +0000
commit5c672eed6432fd4bcf02e83670f9d4e5d9994456 (patch)
treec4f5bd7bc7a82ba740acba4c3dab050e2baa5fef /pkg/sentry/kernel/context.go
parentb8e50d110eb58d1b85b93968358d689dd9250d2d (diff)
parenta99d3479a84ca86843e500dbdf58db0af389b536 (diff)
Merge release-20190806.1-358-ga99d347 (automated)
Diffstat (limited to 'pkg/sentry/kernel/context.go')
-rw-r--r--pkg/sentry/kernel/context.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/context.go b/pkg/sentry/kernel/context.go
index e3f5b0d83..3c9dceaba 100644
--- a/pkg/sentry/kernel/context.go
+++ b/pkg/sentry/kernel/context.go
@@ -15,6 +15,8 @@
package kernel
import (
+ "time"
+
"gvisor.dev/gvisor/pkg/log"
"gvisor.dev/gvisor/pkg/sentry/context"
)
@@ -97,6 +99,21 @@ func TaskFromContext(ctx context.Context) *Task {
return nil
}
+// Deadline implements context.Context.Deadline.
+func (*Task) Deadline() (time.Time, bool) {
+ return time.Time{}, false
+}
+
+// Done implements context.Context.Done.
+func (*Task) Done() <-chan struct{} {
+ return nil
+}
+
+// Err implements context.Context.Err.
+func (*Task) Err() error {
+ return nil
+}
+
// AsyncContext returns a context.Context that may be used by goroutines that
// do work on behalf of t and therefore share its contextual values, but are
// not t's task goroutine (e.g. asynchronous I/O).
@@ -129,6 +146,21 @@ func (ctx taskAsyncContext) IsLogging(level log.Level) bool {
return ctx.t.IsLogging(level)
}
+// Deadline implements context.Context.Deadline.
+func (ctx taskAsyncContext) Deadline() (time.Time, bool) {
+ return ctx.t.Deadline()
+}
+
+// Done implements context.Context.Done.
+func (ctx taskAsyncContext) Done() <-chan struct{} {
+ return ctx.t.Done()
+}
+
+// Err implements context.Context.Err.
+func (ctx taskAsyncContext) Err() error {
+ return ctx.t.Err()
+}
+
// Value implements context.Context.Value.
func (ctx taskAsyncContext) Value(key interface{}) interface{} {
return ctx.t.Value(key)