posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_SPIN_LOCKS

POSIX Spin Locks option group. More...

Functions

int pthread_spin_destroy (pthread_spinlock_t *lock)
 Destroy a spin lock.
 
int pthread_spin_init (pthread_spinlock_t *lock, int pshared)
 Initialise a spin lock.
 
int pthread_spin_lock (pthread_spinlock_t *lock)
 Acquire a spin lock, busy-waiting until available.
 
int pthread_spin_trylock (pthread_spinlock_t *lock)
 Try to acquire a spin lock without busy-waiting.
 
int pthread_spin_unlock (pthread_spinlock_t *lock)
 Release a spin lock.
 

Detailed Description

POSIX Spin Locks option group.

Function Documentation

◆ pthread_spin_destroy()

int pthread_spin_destroy ( pthread_spinlock_t *  lock)

Destroy a spin lock.

Parameters
lockSpin lock to destroy.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_spin_destroy.html

◆ pthread_spin_init()

int pthread_spin_init ( pthread_spinlock_t *  lock,
int  pshared 
)

Initialise a spin lock.

Parameters
lockSpin lock to initialise.
psharedPTHREAD_PROCESS_SHARED or PTHREAD_PROCESS_PRIVATE.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_spin_init.html

◆ pthread_spin_lock()

int pthread_spin_lock ( pthread_spinlock_t *  lock)

Acquire a spin lock, busy-waiting until available.

Parameters
lockSpin lock to acquire.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_spin_lock.html

◆ pthread_spin_trylock()

int pthread_spin_trylock ( pthread_spinlock_t *  lock)

Try to acquire a spin lock without busy-waiting.

Parameters
lockSpin lock to try.
Returns
0 on success, EBUSY if already locked, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_spin_trylock.html

◆ pthread_spin_unlock()

int pthread_spin_unlock ( pthread_spinlock_t *  lock)

Release a spin lock.

Parameters
lockSpin lock to release.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_spin_unlock.html