summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/task_block.go
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-09-17 13:35:00 -0700
committerShentubot <shentubot@google.com>2018-09-17 13:35:54 -0700
commitab6fa44588233fa48d1ae0bf7d9b0d9e984a6af0 (patch)
treeb084d11cc5cc42b68aef31a2244788471ed1af8f /pkg/sentry/kernel/task_block.go
parenta452971630a4b43f671efffdacb5a4892cf25579 (diff)
Allow kernel.(*Task).Block to accept an extract only channel
PiperOrigin-RevId: 213328293 Change-Id: I4164133e6f709ecdb89ffbb5f7df3324c273860a
Diffstat (limited to 'pkg/sentry/kernel/task_block.go')
-rw-r--r--pkg/sentry/kernel/task_block.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/sentry/kernel/task_block.go b/pkg/sentry/kernel/task_block.go
index 9fd24f134..6dc7b938e 100644
--- a/pkg/sentry/kernel/task_block.go
+++ b/pkg/sentry/kernel/task_block.go
@@ -95,7 +95,7 @@ func (t *Task) BlockWithDeadline(C chan struct{}, haveDeadline bool, deadline kt
// Most clients should use BlockWithDeadline or BlockWithTimeout instead.
//
// Preconditions: The caller must be running on the task goroutine.
-func (t *Task) BlockWithTimer(C chan struct{}, tchan <-chan struct{}) error {
+func (t *Task) BlockWithTimer(C <-chan struct{}, tchan <-chan struct{}) error {
return t.block(C, tchan)
}
@@ -104,13 +104,13 @@ func (t *Task) BlockWithTimer(C chan struct{}, tchan <-chan struct{}) error {
// is interrupted.
//
// Preconditions: The caller must be running on the task goroutine.
-func (t *Task) Block(C chan struct{}) error {
+func (t *Task) Block(C <-chan struct{}) error {
return t.block(C, nil)
}
// block blocks a task on one of many events.
// N.B. defer is too expensive to be used here.
-func (t *Task) block(C chan struct{}, timerChan <-chan struct{}) error {
+func (t *Task) block(C <-chan struct{}, timerChan <-chan struct{}) error {
// Fast path if the request is already done.
select {
case <-C: