text
stringlengths 0
234
|
---|
.sh see also
|
.br getmntent (3),
|
.br fstab (5)
|
.sh colophon
|
this page is part of release 5.13 of the linux
|
.i man-pages
|
project.
|
a description of the project,
|
information about reporting bugs,
|
and the latest version of this page,
|
can be found at
|
\%https://www.kernel.org/doc/man\-pages/.
|
.so man3/ctime.3
|
.\" copyright (c) 2017, michael kerrisk <mtk.manpages@gmail.com>
|
.\"
|
.\" %%%license_start(verbatim)
|
.\" permission is granted to make and distribute verbatim copies of this
|
.\" manual provided the copyright notice and this permission notice are
|
.\" preserved on all copies.
|
.\"
|
.\" permission is granted to copy and distribute modified versions of this
|
.\" manual under the conditions for verbatim copying, provided that the
|
.\" entire resulting derived work is distributed under the terms of a
|
.\" permission notice identical to this one.
|
.\"
|
.\" since the linux kernel and libraries are constantly changing, this
|
.\" manual page may be incorrect or out-of-date. the author(s) assume no
|
.\" responsibility for errors or omissions, or for damages resulting from
|
.\" the use of the information contained herein. the author(s) may not
|
.\" have taken the same level of care in the production of this manual,
|
.\" which is licensed free of charge, as they might when working
|
.\" professionally.
|
.\"
|
.\" formatted or processed versions of this manual, if unaccompanied by
|
.\" the source, must acknowledge the copyright and authors of this work.
|
.\" %%%license_end
|
.\"
|
.th pthread_spin_lock 3 2021-03-22 "linux" "linux programmer's manual"
|
.sh name
|
pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock \-
|
lock and unlock a spin lock
|
.sh synopsis
|
.nf
|
.b #include <pthread.h>
|
.pp
|
.bi "int pthread_spin_lock(pthread_spinlock_t *" lock );
|
.bi "int pthread_spin_trylock(pthread_spinlock_t *" lock );
|
.bi "int pthread_spin_unlock(pthread_spinlock_t *" lock );
|
.fi
|
.pp
|
compile and link with \fi\-pthread\fp.
|
.pp
|
.rs -4
|
feature test macro requirements for glibc (see
|
.br feature_test_macros (7)):
|
.re
|
.pp
|
.br pthread_spin_lock (),
|
.br pthread_spin_trylock ():
|
.nf
|
_posix_c_source >= 200112l
|
.fi
|
.sh description
|
the
|
.br pthread_spin_lock ()
|
function locks the spin lock referred to by
|
.ir lock .
|
if the spin lock is currently unlocked,
|
the calling thread acquires the lock immediately.
|
if the spin lock is currently locked by another thread,
|
the calling thread spins, testing the lock until it becomes available,
|
at which point the calling thread acquires the lock.
|
.pp
|
calling
|
.br pthread_spin_lock ()
|
on a lock that is already held by the caller
|
or a lock that has not been initialized with
|
.br pthread_spin_init (3)
|
results in undefined behavior.
|
.pp
|
the
|
.br pthread_spin_trylock ()
|
function is like
|
.br pthread_spin_lock (),
|
except that if the spin lock referred to by
|
.i lock
|
is currently locked,
|
then, instead of spinning, the call returns immediately with the error
|
.br ebusy .
|
.pp
|
the
|
.br pthread_spin_unlock ()
|
function unlocks the spin lock referred to
|
.ir lock .
|
if any threads are spinning on the lock,
|
one of those threads will then acquire the lock.
|
.pp
|
calling
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.