|
NAMEpthread_spin_lock ,
pthread_spin_trylock ,
pthread_spin_unlock —
lock or unlock a spin lock
LIBRARYPOSIX Threads Library (libpthread, -lpthread)SYNOPSIS#include <pthread.h>
int
int
int
DESCRIPTIONThepthread_spin_lock () function will acquire
lock if it is not currently owned by another thread. If
the lock cannot be acquired immediately, it will spin attempting to acquire
the lock (it will not sleep) until it becomes available.
The The RETURN VALUESIf successful, all these functions will return zero. Otherwise, an error number will be returned to indicate the error.None of these functions will return
ERRORSThepthread_spin_lock (),
pthread_spin_trylock () and
pthread_spin_unlock () functions will fail if:
The
The
The
SEE ALSOpthread_spin_destroy(3), pthread_spin_init(3)HISTORYThepthread_spin_lock (),
pthread_spin_trylock () and
pthread_spin_unlock () functions first appeared in
N:M Threading Library (libkse, -lkse) in
FreeBSD 5.2, and in 1:1 Threading
Library (libthr, -lthr) in FreeBSD 5.3.
BUGSThe implementation ofpthread_spin_lock (),
pthread_spin_trylock () and
pthread_spin_unlock () is expected to conform to
IEEE Std 1003.2 (“POSIX.2”).
Visit the GSP FreeBSD Man Page Interface. |