Trait miri::ThreadsEvalContextExt
source · [−]pub trait ThreadsEvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
Show 28 methods
fn get_or_create_thread_local_alloc(
&mut self,
def_id: DefId
) -> InterpResult<'tcx, Pointer<Provenance>> { ... }
fn create_thread(&mut self) -> ThreadId { ... }
fn start_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 has_terminated(&self, thread_id: ThreadId) -> bool { ... }
fn have_all_terminated(&self) -> bool { ... }
fn enable_thread(&mut self, thread_id: ThreadId) { ... }
fn active_thread_stack(
&self
) -> &[Frame<'mir, 'tcx, Provenance, FrameData<'tcx>>] { ... }
fn active_thread_stack_mut(
&mut self
) -> &mut Vec<Frame<'mir, 'tcx, Provenance, FrameData<'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]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [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 FnOnce(&mut InterpCx<'mir, 'tcx, Evaluator<'mir, 'tcx>>) -> InterpResult<'tcx> + 'tcx>
) { ... }
fn unregister_timeout_callback_if_exists(&mut self, thread: ThreadId) { ... }
fn run_timeout_callback(&mut self) -> InterpResult<'tcx> { ... }
fn schedule(&mut self) -> InterpResult<'tcx, SchedulingAction> { ... }
fn thread_terminated(&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.
source
fn create_thread(&mut self) -> ThreadId
sourcefn start_thread(
fn start_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>
sourcefn detach_thread(
fn detach_thread(
&mut self,
thread_id: ThreadId,
allow_terminated_joined: bool
) -> InterpResult<'tcx>
source
fn join_thread(&mut self, joined_thread_id: ThreadId) -> InterpResult<'tcx>
sourcefn join_thread_exclusive(
fn join_thread_exclusive(
&mut self,
joined_thread_id: ThreadId
) -> InterpResult<'tcx>
source
fn set_active_thread(&mut self, thread_id: ThreadId) -> ThreadId
source
fn get_active_thread(&self) -> ThreadId
source
fn active_thread_mut(&mut self) -> &mut Thread<'mir, 'tcx>
source
fn active_thread_ref(&self) -> &Thread<'mir, 'tcx>
source
fn get_total_thread_count(&self) -> usize
source
fn has_terminated(&self, thread_id: ThreadId) -> bool
source
fn have_all_terminated(&self) -> bool
source
fn enable_thread(&mut self, thread_id: ThreadId)
sourcefn active_thread_stack(
fn active_thread_stack(
&self
) -> &[Frame<'mir, 'tcx, Provenance, FrameData<'tcx>>]
sourcefn active_thread_stack_mut(
fn active_thread_stack_mut(
&mut self
) -> &mut Vec<Frame<'mir, 'tcx, Provenance, FrameData<'tcx>>>
source
fn set_thread_name(&mut self, thread: ThreadId, new_thread_name: Vec<u8>)
source
fn set_thread_name_wide(&mut self, thread: ThreadId, new_thread_name: &[u16])
sourcefn get_thread_name<'c>(&'c self, thread: ThreadId) -> &'c [u8]ⓘNotable traits for &[u8]
fn get_thread_name<'c>(&'c self, thread: ThreadId) -> &'c [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
where
'mir: 'c,
source
fn block_thread(&mut self, thread: ThreadId)
source
fn unblock_thread(&mut self, thread: ThreadId)
source
fn yield_active_thread(&mut self)
source
fn maybe_preempt_active_thread(&mut self)
sourcefn register_timeout_callback(
fn register_timeout_callback(
&mut self,
thread: ThreadId,
call_time: Time,
callback: Box<dyn FnOnce(&mut InterpCx<'mir, 'tcx, Evaluator<'mir, 'tcx>>) -> InterpResult<'tcx> + 'tcx>
)
source
fn unregister_timeout_callback_if_exists(&mut self, thread: ThreadId)
sourcefn run_timeout_callback(&mut self) -> InterpResult<'tcx>
fn run_timeout_callback(&mut self) -> InterpResult<'tcx>
Execute a timeout callback on the callback’s thread.
sourcefn schedule(&mut self) -> InterpResult<'tcx, SchedulingAction>
fn schedule(&mut self) -> InterpResult<'tcx, SchedulingAction>
Decide which action to take next and on which thread.
sourcefn thread_terminated(&mut self) -> InterpResult<'tcx>
fn thread_terminated(&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 from tls.rs
after handling the TLS dtors.