BlockWithDeadline blocks t until it is woken by an event, the application monotonic clock indicates a time of deadline (only if haveDeadline is true), or t is interrupted. It returns nil if an event is received from C, ETIMEDOUT if the deadline expired, and linuxerr.ErrInterrupted if t is interrupte
(C <-chan struct{}, haveDeadline bool, deadline ktime.Time)
| 75 | // |
| 76 | // Preconditions: The caller must be running on the task goroutine. |
| 77 | func (t *Task) BlockWithDeadline(C <-chan struct{}, haveDeadline bool, deadline ktime.Time) error { |
| 78 | if !haveDeadline { |
| 79 | return t.block(C, nil) |
| 80 | } |
| 81 | return t.blockWithDeadlineFromSampledClock(C, t.Kernel().MonotonicClock(), deadline) |
| 82 | } |
| 83 | |
| 84 | // BlockWithDeadlineFrom is similar to BlockWithDeadline, except it uses the |
| 85 | // passed clock (instead of application monotonic clock). |
no test coverage detected