Skip to main content

pthread_spin_unlock

Function pthread_spin_unlock 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pthread_spin_unlock( lock: *mut pthread_spinlock_t, ) -> c_int
Expand description

See https://pubs.opengroup.org/onlinepubs/9799919799/functions/pthread_spin_unlock.html.

Releases the spin lock referenced by lock which was locked via the pthread_spin_lock() or pthread_spin_trylock() functions.

Upon success, returns 0. Upon failure, an error number is returned.

§Implementation

Cannot fail on the Rust side so no error number is ever returned.

§Safety

It is undefined behaviour for any of the following:

  • lock is uninitialized.
  • lock is not held by the calling thread.