Skip to main content

EvalContextExt

Trait EvalContextExt 

Source
pub trait EvalContextExt<'tcx>: MiriInterpCxExt<'tcx> {
Show 15 methods // Provided methods fn mutex_lock(&self, mutex_ref: &MutexRef) -> InterpResult<'tcx> { ... } fn mutex_unlock( &mut self, mutex_ref: &MutexRef, ) -> InterpResult<'tcx, Option<usize>> { ... } fn mutex_enqueue_and_block( &mut self, mutex_ref: MutexRef, retval_dest: Option<(Scalar, MPlaceTy<'tcx>)>, ) { ... } fn rwlock_reader_lock(&self, rwlock_ref: &RwLockRef) -> InterpResult<'tcx> { ... } fn rwlock_reader_unlock( &mut self, rwlock_ref: &RwLockRef, ) -> InterpResult<'tcx, bool> { ... } fn rwlock_enqueue_and_block_reader( &mut self, rwlock_ref: RwLockRef, retval: Scalar, dest: MPlaceTy<'tcx>, ) { ... } fn rwlock_writer_lock(&self, rwlock_ref: &RwLockRef) -> InterpResult<'tcx> { ... } fn rwlock_writer_unlock( &mut self, rwlock_ref: &RwLockRef, ) -> InterpResult<'tcx, bool> { ... } fn rwlock_enqueue_and_block_writer( &mut self, rwlock_ref: RwLockRef, retval: Scalar, dest: MPlaceTy<'tcx>, ) { ... } fn condvar_wait( &mut self, condvar_ref: CondvarRef, mutex_ref: MutexRef, deadline: Option<Deadline>, retval_succ: Scalar, retval_timeout: Scalar, dest: MPlaceTy<'tcx>, ) -> InterpResult<'tcx> { ... } fn condvar_signal( &mut self, condvar_ref: &CondvarRef, ) -> InterpResult<'tcx, bool> { ... } fn futex_wait( &mut self, futex_ref: FutexRef, bitset: u32, deadline: Option<Deadline>, callback: DynUnblockCallback<'tcx>, ) { ... } fn futex_wake( &mut self, futex_ref: &FutexRef, bitset: u32, count: usize, ) -> InterpResult<'tcx, usize> { ... } fn semaphore_decrement( &mut self, semaphore_ref: SemaphoreRef, deadline: Option<Deadline>, callback: DynUnblockCallback<'tcx>, ) -> InterpResult<'tcx> { ... } fn semaphore_increment( &mut self, semaphore_ref: &SemaphoreRef, ) -> InterpResult<'tcx, bool> { ... }
}

Provided Methods§

Source

fn mutex_lock(&self, mutex_ref: &MutexRef) -> InterpResult<'tcx>

Lock by setting the mutex owner and increasing the lock count.

Source

fn mutex_unlock( &mut self, mutex_ref: &MutexRef, ) -> InterpResult<'tcx, Option<usize>>

Try unlocking by decreasing the lock count and returning the old lock count. If the lock count reaches 0, release the lock and potentially give to a new owner. If the lock was not locked by the current thread, return None.

Source

fn mutex_enqueue_and_block( &mut self, mutex_ref: MutexRef, retval_dest: Option<(Scalar, MPlaceTy<'tcx>)>, )

Put the thread into the queue waiting for the mutex.

Once the Mutex becomes available and if it exists, retval_dest.0 will be written to retval_dest.1.

Source

fn rwlock_reader_lock(&self, rwlock_ref: &RwLockRef) -> InterpResult<'tcx>

Read-lock the lock by adding the reader the list of threads that own this lock.

Source

fn rwlock_reader_unlock( &mut self, rwlock_ref: &RwLockRef, ) -> InterpResult<'tcx, bool>

Try read-unlock the lock for the current threads and potentially give the lock to a new owner. Returns true if succeeded, false if this reader did not hold the lock.

Source

fn rwlock_enqueue_and_block_reader( &mut self, rwlock_ref: RwLockRef, retval: Scalar, dest: MPlaceTy<'tcx>, )

Put the reader in the queue waiting for the lock and block it. Once the lock becomes available, retval will be written to dest.

Source

fn rwlock_writer_lock(&self, rwlock_ref: &RwLockRef) -> InterpResult<'tcx>

Lock by setting the writer that owns the lock.

Source

fn rwlock_writer_unlock( &mut self, rwlock_ref: &RwLockRef, ) -> InterpResult<'tcx, bool>

Try to unlock an rwlock held by the current thread. Return false if it is held by another thread.

Source

fn rwlock_enqueue_and_block_writer( &mut self, rwlock_ref: RwLockRef, retval: Scalar, dest: MPlaceTy<'tcx>, )

Put the writer in the queue waiting for the lock. Once the lock becomes available, retval will be written to dest.

Source

fn condvar_wait( &mut self, condvar_ref: CondvarRef, mutex_ref: MutexRef, deadline: Option<Deadline>, retval_succ: Scalar, retval_timeout: Scalar, dest: MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

Release the mutex and let the current thread wait on the given condition variable. Once it is signaled, the mutex will be acquired and retval_succ will be written to dest. If the timeout happens first, retval_timeout will be written to dest.

Source

fn condvar_signal( &mut self, condvar_ref: &CondvarRef, ) -> InterpResult<'tcx, bool>

Wake up some thread (if there is any) sleeping on the conditional variable. Returns true iff any thread was woken up.

Source

fn futex_wait( &mut self, futex_ref: FutexRef, bitset: u32, deadline: Option<Deadline>, callback: DynUnblockCallback<'tcx>, )

Wait for the futex to be signaled, or a timeout. Once the thread is unblocked, callback is called with the unblock reason.

Source

fn futex_wake( &mut self, futex_ref: &FutexRef, bitset: u32, count: usize, ) -> InterpResult<'tcx, usize>

Wake up count of the threads in the queue that match any of the bits in the bitset. Returns how many threads were woken.

Source

fn semaphore_decrement( &mut self, semaphore_ref: SemaphoreRef, deadline: Option<Deadline>, callback: DynUnblockCallback<'tcx>, ) -> InterpResult<'tcx>

Tries to decrement the semaphore. Blocks the current thread if that is not possible. callback is invoked after the decrement was successful.

Once the Mutex becomes available and if it exists, retval_dest.0 will be written to retval_dest.1.

Source

fn semaphore_increment( &mut self, semaphore_ref: &SemaphoreRef, ) -> InterpResult<'tcx, bool>

Increment the semaphore. Returns whether anyone was woken up.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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