Next: POSIX Mutexes, Previous: POSIX Barriers, Up: POSIX Threads [Contents][Index]
A spinlock is a low overhead lock suitable for use in a realtime thread where it’s known that the thread won’t be paused by the scheduler. Non-realtime threads should use mutexes instead.
Initializes a spinlock. pshared is one of:
PTHREAD_PROCESS_PRIVATEThis spinlock is private to the process which created it.
PTHREAD_PROCESS_SHAREDThis spinlock is shared across any process that can access it, for example through shared memory.
This documentation is a stub. For additional information on this function, consult the manual page pthread_spin_init(3) See Linux Kernel.
Destroys a spinlock and releases any resources it held. This documentation is a stub. For additional information on this function, consult the manual page pthread_spin_destroy(3) See Linux Kernel.
Locks a spinlock. Only one thread at a time can lock a spinlock. If another thread has locked this spinlock, the calling thread waits until it is unlocked, then attempts to lock it. This documentation is a stub. For additional information on this function, consult the manual page pthread_spin_lock(3) See Linux Kernel.
Unlocks a spinlock. If one or more threads are waiting for the lock
to be unlocked, one of them (unspecified which) will succeed in
locking it, and will return from pthread_spin_lock).
This documentation is a stub. For additional information on this
function, consult the manual page pthread_spin_unlock(3)
See Linux Kernel.
Like pthread_spin_unlock but returns 0 if the lock was
unlocked, or EBUSY if it was locked.
This documentation is a stub. For additional information on this
function, consult the manual page pthread_spin_trylock(3)
See Linux Kernel.
Next: POSIX Mutexes, Previous: POSIX Barriers, Up: POSIX Threads [Contents][Index]