pub trait SyncEvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
Show 26 methods fn mutex_create(&mut self) -> MutexId { ... } fn mutex_get_or_create<F>(
        &mut self,
        existing: F
    ) -> InterpResult<'tcx, MutexId>
   where
        F: FnOnce(&mut MiriEvalContext<'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_create(&mut self) -> RwLockId { ... } fn rwlock_get_or_create<F>(
        &mut self,
        existing: F
    ) -> InterpResult<'tcx, RwLockId>
   where
        F: FnOnce(&mut MiriEvalContext<'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_create(&mut self) -> CondvarId { ... } fn condvar_get_or_create<F>(
        &mut self,
        existing: F
    ) -> InterpResult<'tcx, CondvarId>
   where
        F: FnOnce(&mut MiriEvalContext<'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, mutex: MutexId) { ... } fn condvar_signal(&mut self, id: CondvarId) -> Option<(ThreadId, MutexId)> { ... } 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

Create state for a new mutex.

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

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

Check if locked.

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

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.

Put the thread into the queue waiting for the mutex.

Create state for a new read write lock.

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

Check if locked.

Check if write locked.

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

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.

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

Lock by setting the writer that owns the lock.

Try to unlock by removing the writer.

Put the writer in the queue waiting for the lock.

Create state for a new conditional variable.

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

Is the conditional variable awaited?

Mark that the thread is waiting on the conditional variable.

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

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

Implementors