Trait miri::concurrency::thread::EvalContextExt
source · pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
Show 25 methods
fn get_or_create_thread_local_alloc(
&mut self,
def_id: DefId
) -> InterpResult<'tcx, Pointer<Provenance>> { ... }
fn start_regular_thread(
&mut self,
thread: Option<MPlaceTy<'tcx, Provenance>>,
start_routine: Pointer<Option<Provenance>>,
start_abi: Abi,
func_arg: ImmTy<'tcx, Provenance>,
ret_layout: TyAndLayout<'tcx>
) -> InterpResult<'tcx, ThreadId> { ... }
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 set_active_thread(&mut self, thread_id: ThreadId) -> ThreadId { ... }
fn get_active_thread(&self) -> ThreadId { ... }
fn active_thread_mut(&mut self) -> &mut Thread<'mir, 'tcx> { ... }
fn active_thread_ref(&self) -> &Thread<'mir, '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(
&self
) -> &[Frame<'mir, 'tcx, Provenance, FrameExtra<'tcx>>] { ... }
fn active_thread_stack_mut(
&mut self
) -> &mut Vec<Frame<'mir, 'tcx, Provenance, FrameExtra<'tcx>>> ⓘ { ... }
fn set_thread_name(&mut self, thread: ThreadId, new_thread_name: Vec<u8>) { ... }
fn set_thread_name_wide(&mut self, thread: ThreadId, new_thread_name: &[u16]) { ... }
fn get_thread_name<'c>(&'c self, thread: ThreadId) -> &'c [u8] ⓘ
where
'mir: 'c,
{ ... }
fn block_thread(&mut self, thread: ThreadId) { ... }
fn unblock_thread(&mut self, thread: ThreadId) { ... }
fn yield_active_thread(&mut self) { ... }
fn maybe_preempt_active_thread(&mut self) { ... }
fn register_timeout_callback(
&mut self,
thread: ThreadId,
call_time: Time,
callback: Box<dyn MachineCallback<'mir, 'tcx> + 'tcx>
) { ... }
fn unregister_timeout_callback_if_exists(&mut self, thread: ThreadId) { ... }
fn run_threads(&mut self) -> InterpResult<'tcx, !> { ... }
fn terminate_active_thread(&mut self) -> InterpResult<'tcx> { ... }
}
Provided Methods§
sourcefn get_or_create_thread_local_alloc(
&mut self,
def_id: DefId
) -> InterpResult<'tcx, Pointer<Provenance>>
fn get_or_create_thread_local_alloc(
&mut self,
def_id: DefId
) -> InterpResult<'tcx, Pointer<Provenance>>
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, Provenance>>,
start_routine: Pointer<Option<Provenance>>,
start_abi: Abi,
func_arg: ImmTy<'tcx, Provenance>,
ret_layout: TyAndLayout<'tcx>
) -> InterpResult<'tcx, ThreadId>
fn start_regular_thread(
&mut self,
thread: Option<MPlaceTy<'tcx, Provenance>>,
start_routine: Pointer<Option<Provenance>>,
start_abi: Abi,
func_arg: ImmTy<'tcx, Provenance>,
ret_layout: TyAndLayout<'tcx>
) -> InterpResult<'tcx, ThreadId>
Start a regular (non-main) thread.
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 set_active_thread(&mut self, thread_id: ThreadId) -> ThreadId
fn get_active_thread(&self) -> ThreadId
fn active_thread_mut(&mut self) -> &mut Thread<'mir, 'tcx>
fn active_thread_ref(&self) -> &Thread<'mir, '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(
&self
) -> &[Frame<'mir, 'tcx, Provenance, FrameExtra<'tcx>>]
fn active_thread_stack_mut(
&mut self
) -> &mut Vec<Frame<'mir, '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 set_thread_name_wide(&mut self, thread: ThreadId, new_thread_name: &[u16])
fn get_thread_name<'c>(&'c self, thread: ThreadId) -> &'c [u8] ⓘwhere
'mir: 'c,
fn block_thread(&mut self, thread: ThreadId)
fn unblock_thread(&mut self, thread: ThreadId)
fn yield_active_thread(&mut self)
fn maybe_preempt_active_thread(&mut self)
fn register_timeout_callback(
&mut self,
thread: ThreadId,
call_time: Time,
callback: Box<dyn MachineCallback<'mir, 'tcx> + 'tcx>
)
fn unregister_timeout_callback_if_exists(&mut self, thread: ThreadId)
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).
sourcefn terminate_active_thread(&mut self) -> InterpResult<'tcx>
fn terminate_active_thread(&mut self) -> InterpResult<'tcx>
Handles thread termination of the active thread: wakes up threads joining on this one, and deallocated thread-local statics.
This is called by the eval loop when a thread’s on_stack_empty returns Ready
.