Function wasmer_wasix::utils::owned_mutex_guard::write_owned

source ·
pub(crate) fn write_owned<T>(
    lock: &Arc<RwLock<T>>,
) -> LockResult<OwnedRwLockWriteGuard<T>>
Expand description

Locks this rwlock with exclusive write access, blocking the current thread until it can be acquired.

This function will not return while other writers or other readers currently have access to the lock.

Returns an RAII guard which will drop the write access of this rwlock when dropped.

§Errors

This function will return an error if the RwLock is poisoned. An RwLock is poisoned whenever a writer panics while holding an exclusive lock. An error will be returned when the lock is acquired.

§Panics

This function might panic when called if the lock is already held by the current thread.