Function cloudabi::lock_unlock [] [src]

pub unsafe fn lock_unlock(lock_: *mut lock, scope_: scope) -> errno

Unlocks a write-locked userspace lock.

If a userspace lock is unlocked while having its LOCK_KERNEL_MANAGED flag set, the lock cannot be unlocked in userspace directly. This system call needs to be performed instead, so that any waiting threads can be woken up.

To prevent spurious invocations of this system call, the lock must be locked for writing. This prevents other threads from acquiring additional read locks while the system call is in progress. If the lock is acquired for reading, it must first be upgraded to a write lock.

Parameters

lock: The userspace lock that is locked for writing by the calling thread.

scope: Whether the lock is stored in private or shared memory.