pub trait EvalContextExt<'tcx>: MiriInterpCxExt<'tcx> {
Show 22 methods
// Provided methods
fn thread_id_try_from(
&self,
id: impl TryInto<u32>,
) -> Result<ThreadId, ThreadNotFound> { ... }
fn get_or_create_thread_local_alloc(
&mut self,
def_id: DefId,
) -> InterpResult<'tcx, StrictPointer> { ... }
fn start_regular_thread(
&mut self,
thread: Option<MPlaceTy<'tcx>>,
start_routine: Pointer,
start_abi: ExternAbi,
func_arg: ImmTy<'tcx>,
ret_layout: TyAndLayout<'tcx>,
) -> InterpResult<'tcx, ThreadId> { ... }
fn terminate_active_thread(
&mut self,
tls_alloc_action: TlsAllocAction,
) -> InterpResult<'tcx> { ... }
fn block_thread(
&mut self,
reason: BlockReason,
timeout: Option<(TimeoutClock, TimeoutAnchor, Duration)>,
callback: Box<dyn UnblockCallback<'tcx> + 'tcx>,
) { ... }
fn unblock_thread(
&mut self,
thread: ThreadId,
reason: BlockReason,
) -> InterpResult<'tcx> { ... }
fn detach_thread(
&mut self,
thread_id: ThreadId,
allow_terminated_joined: bool,
) -> InterpResult<'tcx> { ... }
fn join_thread(&mut self, joined_thread_id: ThreadId) -> InterpResult<'tcx> { ... }
fn join_thread_exclusive(
&mut self,
joined_thread_id: ThreadId,
) -> InterpResult<'tcx> { ... }
fn active_thread(&self) -> ThreadId { ... }
fn active_thread_mut(&mut self) -> &mut Thread<'tcx> { ... }
fn active_thread_ref(&self) -> &Thread<'tcx> { ... }
fn get_total_thread_count(&self) -> usize { ... }
fn have_all_terminated(&self) -> bool { ... }
fn enable_thread(&mut self, thread_id: ThreadId) { ... }
fn active_thread_stack<'a>(
&'a self,
) -> &'a [Frame<'tcx, Provenance, FrameExtra<'tcx>>] { ... }
fn active_thread_stack_mut<'a>(
&'a mut self,
) -> &'a mut Vec<Frame<'tcx, Provenance, FrameExtra<'tcx>>> { ... }
fn set_thread_name(&mut self, thread: ThreadId, new_thread_name: Vec<u8>) { ... }
fn get_thread_name<'c>(&'c self, thread: ThreadId) -> Option<&'c [u8]>
where 'tcx: 'c { ... }
fn yield_active_thread(&mut self) { ... }
fn maybe_preempt_active_thread(&mut self) { ... }
fn run_threads(&mut self) -> InterpResult<'tcx, !> { ... }
}
Provided Methods§
fn thread_id_try_from( &self, id: impl TryInto<u32>, ) -> Result<ThreadId, ThreadNotFound>
Sourcefn get_or_create_thread_local_alloc(
&mut self,
def_id: DefId,
) -> InterpResult<'tcx, StrictPointer>
fn get_or_create_thread_local_alloc( &mut self, def_id: DefId, ) -> InterpResult<'tcx, StrictPointer>
Get a thread-specific allocation id for the given thread-local static. If needed, allocate a new one.
Sourcefn start_regular_thread(
&mut self,
thread: Option<MPlaceTy<'tcx>>,
start_routine: Pointer,
start_abi: ExternAbi,
func_arg: ImmTy<'tcx>,
ret_layout: TyAndLayout<'tcx>,
) -> InterpResult<'tcx, ThreadId>
fn start_regular_thread( &mut self, thread: Option<MPlaceTy<'tcx>>, start_routine: Pointer, start_abi: ExternAbi, func_arg: ImmTy<'tcx>, ret_layout: TyAndLayout<'tcx>, ) -> InterpResult<'tcx, ThreadId>
Start a regular (non-main) thread.
Sourcefn terminate_active_thread(
&mut self,
tls_alloc_action: TlsAllocAction,
) -> InterpResult<'tcx>
fn terminate_active_thread( &mut self, tls_alloc_action: TlsAllocAction, ) -> InterpResult<'tcx>
Handles thread termination of the active thread: wakes up threads joining on this one,
and deals with the thread’s thread-local statics according to tls_alloc_action
.
This is called by the eval loop when a thread’s on_stack_empty returns Ready
.
Sourcefn block_thread(
&mut self,
reason: BlockReason,
timeout: Option<(TimeoutClock, TimeoutAnchor, Duration)>,
callback: Box<dyn UnblockCallback<'tcx> + 'tcx>,
)
fn block_thread( &mut self, reason: BlockReason, timeout: Option<(TimeoutClock, TimeoutAnchor, Duration)>, callback: Box<dyn UnblockCallback<'tcx> + 'tcx>, )
Block the current thread, with an optional timeout. The callback will be invoked when the thread gets unblocked.
Sourcefn unblock_thread(
&mut self,
thread: ThreadId,
reason: BlockReason,
) -> InterpResult<'tcx>
fn unblock_thread( &mut self, thread: ThreadId, reason: BlockReason, ) -> InterpResult<'tcx>
Put the blocked thread into the enabled state. Sanity-checks that the thread previously was blocked for the right reason.
fn detach_thread( &mut self, thread_id: ThreadId, allow_terminated_joined: bool, ) -> InterpResult<'tcx>
fn join_thread(&mut self, joined_thread_id: ThreadId) -> InterpResult<'tcx>
fn join_thread_exclusive( &mut self, joined_thread_id: ThreadId, ) -> InterpResult<'tcx>
fn active_thread(&self) -> ThreadId
fn active_thread_mut(&mut self) -> &mut Thread<'tcx>
fn active_thread_ref(&self) -> &Thread<'tcx>
fn get_total_thread_count(&self) -> usize
fn have_all_terminated(&self) -> bool
fn enable_thread(&mut self, thread_id: ThreadId)
fn active_thread_stack<'a>( &'a self, ) -> &'a [Frame<'tcx, Provenance, FrameExtra<'tcx>>]
fn active_thread_stack_mut<'a>( &'a mut self, ) -> &'a mut Vec<Frame<'tcx, Provenance, FrameExtra<'tcx>>>
Sourcefn set_thread_name(&mut self, thread: ThreadId, new_thread_name: Vec<u8>)
fn set_thread_name(&mut self, thread: ThreadId, new_thread_name: Vec<u8>)
Set the name of the current thread. The buffer must not include the null terminator.
fn get_thread_name<'c>(&'c self, thread: ThreadId) -> Option<&'c [u8]>where
'tcx: 'c,
fn yield_active_thread(&mut self)
fn maybe_preempt_active_thread(&mut self)
Sourcefn run_threads(&mut self) -> InterpResult<'tcx, !>
fn run_threads(&mut self) -> InterpResult<'tcx, !>
Run the core interpreter loop. Returns only when an interrupt occurs (an error or program termination).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.