pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
Show 26 methods // Provided methods fn mutex_get_or_create_id( &mut self, lock_op: &OpTy<'tcx, Provenance>, lock_layout: TyAndLayout<'tcx>, offset: u64 ) -> InterpResult<'tcx, MutexId> { ... } fn rwlock_get_or_create_id( &mut self, lock_op: &OpTy<'tcx, Provenance>, lock_layout: TyAndLayout<'tcx>, offset: u64 ) -> InterpResult<'tcx, RwLockId> { ... } fn condvar_get_or_create_id( &mut self, lock_op: &OpTy<'tcx, Provenance>, lock_layout: TyAndLayout<'tcx>, offset: u64 ) -> InterpResult<'tcx, CondvarId> { ... } fn mutex_get_or_create<F>( &mut self, existing: F ) -> InterpResult<'tcx, MutexId> where F: FnOnce(&mut MiriInterpCx<'mir, 'tcx>, MutexId) -> InterpResult<'tcx, Option<MutexId>> { ... } fn mutex_get_owner(&mut self, id: MutexId) -> ThreadId { ... } fn mutex_is_locked(&self, id: MutexId) -> bool { ... } fn mutex_lock(&mut self, id: MutexId, thread: ThreadId) { ... } fn mutex_unlock( &mut self, id: MutexId, expected_owner: ThreadId ) -> Option<usize> { ... } fn mutex_enqueue_and_block(&mut self, id: MutexId, thread: ThreadId) { ... } fn rwlock_get_or_create<F>( &mut self, existing: F ) -> InterpResult<'tcx, RwLockId> where F: FnOnce(&mut MiriInterpCx<'mir, 'tcx>, RwLockId) -> InterpResult<'tcx, Option<RwLockId>> { ... } fn rwlock_is_locked(&self, id: RwLockId) -> bool { ... } fn rwlock_is_write_locked(&self, id: RwLockId) -> bool { ... } fn rwlock_reader_lock(&mut self, id: RwLockId, reader: ThreadId) { ... } fn rwlock_reader_unlock(&mut self, id: RwLockId, reader: ThreadId) -> bool { ... } fn rwlock_enqueue_and_block_reader( &mut self, id: RwLockId, reader: ThreadId ) { ... } fn rwlock_writer_lock(&mut self, id: RwLockId, writer: ThreadId) { ... } fn rwlock_writer_unlock( &mut self, id: RwLockId, expected_writer: ThreadId ) -> bool { ... } fn rwlock_enqueue_and_block_writer( &mut self, id: RwLockId, writer: ThreadId ) { ... } fn condvar_get_or_create<F>( &mut self, existing: F ) -> InterpResult<'tcx, CondvarId> where F: FnOnce(&mut MiriInterpCx<'mir, 'tcx>, CondvarId) -> InterpResult<'tcx, Option<CondvarId>> { ... } fn condvar_is_awaited(&mut self, id: CondvarId) -> bool { ... } fn condvar_wait( &mut self, id: CondvarId, thread: ThreadId, lock: CondvarLock ) { ... } fn condvar_signal( &mut self, id: CondvarId ) -> Option<(ThreadId, CondvarLock)> { ... } fn condvar_remove_waiter(&mut self, id: CondvarId, thread: ThreadId) { ... } fn futex_wait(&mut self, addr: u64, thread: ThreadId, bitset: u32) { ... } fn futex_wake(&mut self, addr: u64, bitset: u32) -> Option<ThreadId> { ... } fn futex_remove_waiter(&mut self, addr: u64, thread: ThreadId) { ... }
}

Provided Methods§

source

fn mutex_get_or_create_id( &mut self, lock_op: &OpTy<'tcx, Provenance>, lock_layout: TyAndLayout<'tcx>, offset: u64 ) -> InterpResult<'tcx, MutexId>

source

fn rwlock_get_or_create_id( &mut self, lock_op: &OpTy<'tcx, Provenance>, lock_layout: TyAndLayout<'tcx>, offset: u64 ) -> InterpResult<'tcx, RwLockId>

source

fn condvar_get_or_create_id( &mut self, lock_op: &OpTy<'tcx, Provenance>, lock_layout: TyAndLayout<'tcx>, offset: u64 ) -> InterpResult<'tcx, CondvarId>

source

fn mutex_get_or_create<F>(&mut self, existing: F) -> InterpResult<'tcx, MutexId>
where F: FnOnce(&mut MiriInterpCx<'mir, 'tcx>, MutexId) -> InterpResult<'tcx, Option<MutexId>>,

Provides the closure with the next MutexId. Creates that mutex if the closure returns None, otherwise returns the value from the closure

source

fn mutex_get_owner(&mut self, id: MutexId) -> ThreadId

Get the id of the thread that currently owns this lock.

source

fn mutex_is_locked(&self, id: MutexId) -> bool

Check if locked.

source

fn mutex_lock(&mut self, id: MutexId, thread: ThreadId)

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

source

fn mutex_unlock( &mut self, id: MutexId, expected_owner: ThreadId ) -> 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 expected_owner, return None.

source

fn mutex_enqueue_and_block(&mut self, id: MutexId, thread: ThreadId)

Put the thread into the queue waiting for the mutex.

source

fn rwlock_get_or_create<F>( &mut self, existing: F ) -> InterpResult<'tcx, RwLockId>
where F: FnOnce(&mut MiriInterpCx<'mir, 'tcx>, RwLockId) -> InterpResult<'tcx, Option<RwLockId>>,

Provides the closure with the next RwLockId. Creates that RwLock if the closure returns None, otherwise returns the value from the closure

source

fn rwlock_is_locked(&self, id: RwLockId) -> bool

Check if locked.

source

fn rwlock_is_write_locked(&self, id: RwLockId) -> bool

Check if write locked.

source

fn rwlock_reader_lock(&mut self, id: RwLockId, reader: ThreadId)

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

source

fn rwlock_reader_unlock(&mut self, id: RwLockId, reader: ThreadId) -> bool

Try read-unlock the lock for reader 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, id: RwLockId, reader: ThreadId)

Put the reader in the queue waiting for the lock and block it.

source

fn rwlock_writer_lock(&mut self, id: RwLockId, writer: ThreadId)

Lock by setting the writer that owns the lock.

source

fn rwlock_writer_unlock( &mut self, id: RwLockId, expected_writer: ThreadId ) -> bool

Try to unlock by removing the writer.

source

fn rwlock_enqueue_and_block_writer(&mut self, id: RwLockId, writer: ThreadId)

Put the writer in the queue waiting for the lock.

source

fn condvar_get_or_create<F>( &mut self, existing: F ) -> InterpResult<'tcx, CondvarId>
where F: FnOnce(&mut MiriInterpCx<'mir, 'tcx>, CondvarId) -> InterpResult<'tcx, Option<CondvarId>>,

Provides the closure with the next CondvarId. Creates that Condvar if the closure returns None, otherwise returns the value from the closure

source

fn condvar_is_awaited(&mut self, id: CondvarId) -> bool

Is the conditional variable awaited?

source

fn condvar_wait(&mut self, id: CondvarId, thread: ThreadId, lock: CondvarLock)

Mark that the thread is waiting on the conditional variable.

source

fn condvar_signal(&mut self, id: CondvarId) -> Option<(ThreadId, CondvarLock)>

Wake up some thread (if there is any) sleeping on the conditional variable.

source

fn condvar_remove_waiter(&mut self, id: CondvarId, thread: ThreadId)

Remove the thread from the queue of threads waiting on this conditional variable.

source

fn futex_wait(&mut self, addr: u64, thread: ThreadId, bitset: u32)

source

fn futex_wake(&mut self, addr: u64, bitset: u32) -> Option<ThreadId>

source

fn futex_remove_waiter(&mut self, addr: u64, thread: ThreadId)

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for MiriInterpCx<'mir, 'tcx>