MCPcopy
hub / github.com/google/gvisor / BlockWithDeadline

Method BlockWithDeadline

pkg/sentry/kernel/task_block.go:77–82  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

75//
76// Preconditions: The caller must be running on the task goroutine.
77func (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).

Callers 15

waitEpollFunction · 0.80
waitForRequestFunction · 0.80
futexWaitAbsoluteFunction · 0.80
readFunction · 0.80
preadFunction · 0.80
writeFunction · 0.80
pwriteFunction · 0.80
SendMsgMethod · 0.80
RecvMsgMethod · 0.80
waitEventTMethod · 0.80
RecvMsgMethod · 0.80
SendMsgMethod · 0.80

Calls 4

blockMethod · 0.95
KernelMethod · 0.95
MonotonicClockMethod · 0.80

Tested by

no test coverage detected