Skip to main content

pthread_spin_destroy

Function pthread_spin_destroy 

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

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

Destroys the spin lock referenced by lock and releases any resources used by the lock.

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:

  • Subsequent use of lock after calling this function unless it is reinitialized with pthread_spin_init().
  • This function is called when a thread holds the lock.
  • lock is uninitialized when this function is called.