Skip to main content

EvalContextExt

Trait EvalContextExt 

Source
pub trait EvalContextExt<'tcx>: MiriInterpCxExt<'tcx> {
    // Provided method
    fn block_thread_for_io(
        &mut self,
        source_fd: FileDescriptionRef<dyn SourceFileDescription>,
        interest: BlockingIoInterest,
        timeout: Option<(TimeoutClock, TimeoutAnchor, Duration)>,
        callback: DynUnblockCallback<'tcx>,
    ) -> InterpResult<'tcx> { ... }
}

Provided Methods§

Source

fn block_thread_for_io( &mut self, source_fd: FileDescriptionRef<dyn SourceFileDescription>, interest: BlockingIoInterest, timeout: Option<(TimeoutClock, TimeoutAnchor, Duration)>, callback: DynUnblockCallback<'tcx>, ) -> InterpResult<'tcx>

Block the current thread until some interests on an I/O source are fulfilled or the optional timeout exceeded. The callback will be invoked when the thread gets unblocked.

Note that an error interest is implicitly added to interest. This means that the thread will also be unblocked when the error readiness gets set for the source even when the requested interest might not be fulfilled.

There can also be spurious wake-ups by the OS and thus it’s the callers responsibility to verify that the requested I/O interests are really ready and to block again if they’re not.

It’s the callers responsibility to remove the BlockingIoInterest from the blocking I/O manager in the provided callback function.

Implementors§

Source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>