# phpman > man > pthreads(7)

[PTHREADS(7)](https://www.chedong.com/phpMan.php/man/PTHREADS/7/markdown)                           Linux Programmer's Manual                          [PTHREADS(7)](https://www.chedong.com/phpMan.php/man/PTHREADS/7/markdown)



## NAME
       pthreads - POSIX threads

## DESCRIPTION
       POSIX.1 specifies a set of interfaces (functions, header files) for threaded programming com‐
       monly known as POSIX threads, or Pthreads.  A single process can  contain  multiple  threads,
       all  of  which  are  executing  the same program.  These threads share the same global memory
       (data and heap segments), but each thread has its own stack (automatic variables).

       POSIX.1 also requires that threads share a range of other attributes (i.e., these  attributes
       are process-wide rather than per-thread):

       -  process ID

       -  parent process ID

       -  process group ID and session ID

       -  controlling terminal

       -  user and group IDs

       -  open file descriptors

       -  record locks (see [**fcntl**(2)](https://www.chedong.com/phpMan.php/man/fcntl/2/markdown))

       -  signal dispositions

       -  file mode creation mask ([**umask**(2)](https://www.chedong.com/phpMan.php/man/umask/2/markdown))

       -  current directory ([**chdir**(2)](https://www.chedong.com/phpMan.php/man/chdir/2/markdown)) and root directory ([**chroot**(2)](https://www.chedong.com/phpMan.php/man/chroot/2/markdown))

       -  interval timers ([**setitimer**(2)](https://www.chedong.com/phpMan.php/man/setitimer/2/markdown)) and POSIX timers (**timer**___**[create**(2)](https://www.chedong.com/phpMan.php/man/create/2/markdown))

       -  nice value ([**setpriority**(2)](https://www.chedong.com/phpMan.php/man/setpriority/2/markdown))

       -  resource limits ([**setrlimit**(2)](https://www.chedong.com/phpMan.php/man/setrlimit/2/markdown))

       -  measurements of the consumption of CPU time ([**times**(2)](https://www.chedong.com/phpMan.php/man/times/2/markdown)) and resources ([**getrusage**(2)](https://www.chedong.com/phpMan.php/man/getrusage/2/markdown))

       As  well  as the stack, POSIX.1 specifies that various other attributes are distinct for each
       thread, including:

       -  thread ID (the _pthread_t_ data type)

       -  signal mask (**pthread**___**[sigmask**(3)](https://www.chedong.com/phpMan.php/man/sigmask/3/markdown))

       -  the _errno_ variable

       -  alternate signal stack ([**sigaltstack**(2)](https://www.chedong.com/phpMan.php/man/sigaltstack/2/markdown))

       -  real-time scheduling policy and priority ([**sched**(7)](https://www.chedong.com/phpMan.php/man/sched/7/markdown))

       The following Linux-specific features are also per-thread:

       -  capabilities (see [**capabilities**(7)](https://www.chedong.com/phpMan.php/man/capabilities/7/markdown))

       -  CPU affinity (**sched**___**[setaffinity**(2)](https://www.chedong.com/phpMan.php/man/setaffinity/2/markdown))

### Pthreads function return values
       Most pthreads functions return 0 on success, and an error number on failure.  The error  num‐
       bers  that  can  be  returned have the same meaning as the error numbers returned in _errno_ by
       conventional system calls and C library functions.  Note that the pthreads functions  do  not
       set  _errno_.  For each of the pthreads functions that can return an error, POSIX.1-2001 speci‐
       fies that the function can never fail with the error **EINTR**.

### Thread IDs
       Each of the threads in a  process  has  a  unique  thread  identifier  (stored  in  the  type
       _pthread_t_).  This identifier is returned to the caller of **pthread**___**[create**(3)](https://www.chedong.com/phpMan.php/man/create/3/markdown), and a thread can
       obtain its own thread identifier using **pthread**___**[self**(3)](https://www.chedong.com/phpMan.php/man/self/3/markdown).

       Thread IDs are guaranteed to be unique only within a process.   (In  all  pthreads  functions
       that  accept a thread ID as an argument, that ID by definition refers to a thread in the same
       process as the caller.)

       The system may reuse a thread ID after a terminated thread has been  joined,  or  a  detached
       thread  has  terminated.   POSIX  says:  "If an application attempts to use a thread ID whose
       lifetime has ended, the behavior is undefined."

### Thread-safe functions
       A thread-safe function is one that can be safely (i.e., it will deliver the same results  re‐
       gardless of whether it is) called from multiple threads at the same time.

       POSIX.1-2001  and  POSIX.1-2008 require that all functions specified in the standard shall be
       thread-safe, except for the following functions:

           asctime()
           basename()
           catgets()
           crypt()
           ctermid() if passed a non-NULL argument
           ctime()
           dbm_clearerr()
           dbm_close()
           dbm_delete()
           dbm_error()
           dbm_fetch()
           dbm_firstkey()
           dbm_nextkey()
           dbm_open()
           dbm_store()
           dirname()
           dlerror()
           drand48()
           ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
           encrypt()
           endgrent()
           endpwent()
           endutxent()
           fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
           ftw()
           gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
           getc_unlocked()
           getchar_unlocked()
           getdate()
           getenv()
           getgrent()
           getgrgid()
           getgrnam()
           gethostbyaddr() [POSIX.1-2001 only (function removed in
                            POSIX.1-2008)]
           gethostbyname() [POSIX.1-2001 only (function removed in
                            POSIX.1-2008)]
           gethostent()
           getlogin()
           getnetbyaddr()
           getnetbyname()
           getnetent()
           getopt()
           getprotobyname()
           getprotobynumber()
           getprotoent()
           getpwent()
           getpwnam()
           getpwuid()
           getservbyname()
           getservbyport()
           getservent()
           getutxent()
           getutxid()
           getutxline()
           gmtime()
           hcreate()
           hdestroy()
           hsearch()
           inet_ntoa()
           l64a()
           lgamma()
           lgammaf()
           lgammal()
           localeconv()
           localtime()
           lrand48()
           mrand48()
           nftw()
           nl_langinfo()
           ptsname()
           putc_unlocked()
           putchar_unlocked()
           putenv()
           pututxline()
           rand()
           readdir()
           setenv()
           setgrent()
           setkey()
           setpwent()
           setutxent()
           strerror()
           strsignal() [Added in POSIX.1-2008]
           strtok()
           system() [Added in POSIX.1-2008]
           tmpnam() if passed a non-NULL argument
           ttyname()
           unsetenv()
           wcrtomb() if its final argument is NULL
           wcsrtombs() if its final argument is NULL
           wcstombs()
           wctomb()

### Async-cancel-safe functions
       An async-cancel-safe function is one that can be safely called in an application where  asyn‐
       chronous cancelability is enabled (see **pthread**___**[setcancelstate**(3)](https://www.chedong.com/phpMan.php/man/setcancelstate/3/markdown)).

       Only  the  following  functions  are  required  to  be  async-cancel-safe by POSIX.1-2001 and
       POSIX.1-2008:

           pthread_cancel()
           pthread_setcancelstate()
           pthread_setcanceltype()

### Cancellation points
       POSIX.1 specifies that certain functions must, and certain other functions may, be  cancella‐
       tion  points.  If a thread is cancelable, its cancelability type is deferred, and a cancella‐
       tion request is pending for the thread, then the thread is canceled when it calls a  function
       that is a cancellation point.

       The  following  functions  are  required  to  be  cancellation  points by POSIX.1-2001 and/or
       POSIX.1-2008:

           accept()
           aio_suspend()
           clock_nanosleep()
           close()
           connect()
           creat()
           fcntl() F_SETLKW
           fdatasync()
           fsync()
           getmsg()
           getpmsg()
           lockf() F_LOCK
           mq_receive()
           mq_send()
           mq_timedreceive()
           mq_timedsend()
           msgrcv()
           msgsnd()
           msync()
           nanosleep()
           open()
           openat() [Added in POSIX.1-2008]
           pause()
           poll()
           pread()
           pselect()
           pthread_cond_timedwait()
           pthread_cond_wait()
           pthread_join()
           pthread_testcancel()
           putmsg()
           putpmsg()
           pwrite()
           read()
           readv()
           recv()
           recvfrom()
           recvmsg()
           select()
           sem_timedwait()
           sem_wait()
           send()
           sendmsg()
           sendto()
           sigpause() [POSIX.1-2001 only (moves to "may" list in POSIX.1-2008)]
           sigsuspend()
           sigtimedwait()
           sigwait()
           sigwaitinfo()
           sleep()
           system()
           tcdrain()
           usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
           wait()
           waitid()
           waitpid()
           write()
           writev()

       The  following  functions  may  be  cancellation  points  according  to  POSIX.1-2001  and/or
       POSIX.1-2008:

           access()
           asctime()
           asctime_r()
           catclose()
           catgets()
           catopen()
           chmod() [Added in POSIX.1-2008]
           chown() [Added in POSIX.1-2008]
           closedir()
           closelog()
           ctermid()
           ctime()
           ctime_r()
           dbm_close()
           dbm_delete()
           dbm_fetch()
           dbm_nextkey()
           dbm_open()
           dbm_store()
           dlclose()
           dlopen()
           dprintf() [Added in POSIX.1-2008]
           endgrent()
           endhostent()
           endnetent()
           endprotoent()
           endpwent()
           endservent()
           endutxent()
           faccessat() [Added in POSIX.1-2008]
           fchmod() [Added in POSIX.1-2008]
           fchmodat() [Added in POSIX.1-2008]
           fchown() [Added in POSIX.1-2008]
           fchownat() [Added in POSIX.1-2008]
           fclose()
           fcntl() (for any value of cmd argument)
           fflush()
           fgetc()
           fgetpos()
           fgets()
           fgetwc()
           fgetws()
           fmtmsg()
           fopen()
           fpathconf()
           fprintf()
           fputc()
           fputs()
           fputwc()
           fputws()
           fread()
           freopen()
           fscanf()
           fseek()
           fseeko()
           fsetpos()
           fstat()
           fstatat() [Added in POSIX.1-2008]
           ftell()
           ftello()
           ftw()
           futimens() [Added in POSIX.1-2008]
           fwprintf()
           fwrite()
           fwscanf()
           getaddrinfo()
           getc()
           getc_unlocked()
           getchar()
           getchar_unlocked()
           getcwd()
           getdate()
           getdelim() [Added in POSIX.1-2008]
           getgrent()
           getgrgid()
           getgrgid_r()
           getgrnam()
           getgrnam_r()
           gethostbyaddr() [POSIX.1-2001 only (function removed in
                            POSIX.1-2008)]
           gethostbyname() [POSIX.1-2001 only (function removed in
                            POSIX.1-2008)]
           gethostent()
           gethostid()
           gethostname()
           getline() [Added in POSIX.1-2008]
           getlogin()
           getlogin_r()
           getnameinfo()
           getnetbyaddr()
           getnetbyname()
           getnetent()
           getopt() (if opterr is nonzero)
           getprotobyname()
           getprotobynumber()
           getprotoent()
           getpwent()
           getpwnam()
           getpwnam_r()
           getpwuid()
           getpwuid_r()
           gets()
           getservbyname()
           getservbyport()
           getservent()
           getutxent()
           getutxid()
           getutxline()
           getwc()
           getwchar()
           getwd() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
           glob()
           iconv_close()
           iconv_open()
           ioctl()
           link()
           linkat() [Added in POSIX.1-2008]
           lio_listio() [Added in POSIX.1-2008]
           localtime()
           localtime_r()
           lockf() [Added in POSIX.1-2008]
           lseek()
           lstat()
           mkdir() [Added in POSIX.1-2008]
           mkdirat() [Added in POSIX.1-2008]
           mkdtemp() [Added in POSIX.1-2008]
           mkfifo() [Added in POSIX.1-2008]
           mkfifoat() [Added in POSIX.1-2008]
           mknod() [Added in POSIX.1-2008]
           mknodat() [Added in POSIX.1-2008]
           mkstemp()
           mktime()
           nftw()
           opendir()
           openlog()
           pathconf()
           pclose()
           perror()
           popen()
           posix_fadvise()
           posix_fallocate()
           posix_madvise()
           posix_openpt()
           posix_spawn()
           posix_spawnp()
           posix_trace_clear()
           posix_trace_close()
           posix_trace_create()
           posix_trace_create_withlog()
           posix_trace_eventtypelist_getnext_id()
           posix_trace_eventtypelist_rewind()
           posix_trace_flush()
           posix_trace_get_attr()
           posix_trace_get_filter()
           posix_trace_get_status()
           posix_trace_getnext_event()
           posix_trace_open()
           posix_trace_rewind()
           posix_trace_set_filter()
           posix_trace_shutdown()
           posix_trace_timedgetnext_event()
           posix_typed_mem_open()
           printf()
           psiginfo() [Added in POSIX.1-2008]
           psignal() [Added in POSIX.1-2008]
           pthread_rwlock_rdlock()
           pthread_rwlock_timedrdlock()
           pthread_rwlock_timedwrlock()
           pthread_rwlock_wrlock()
           putc()
           putc_unlocked()
           putchar()
           putchar_unlocked()
           puts()
           pututxline()
           putwc()
           putwchar()
           readdir()
           readdir_r()
           readlink() [Added in POSIX.1-2008]
           readlinkat() [Added in POSIX.1-2008]
           remove()
           rename()
           renameat() [Added in POSIX.1-2008]
           rewind()
           rewinddir()
           scandir() [Added in POSIX.1-2008]
           scanf()
           seekdir()
           semop()
           setgrent()
           sethostent()
           setnetent()
           setprotoent()
           setpwent()
           setservent()
           setutxent()
           sigpause() [Added in POSIX.1-2008]
           stat()
           strerror()
           strerror_r()
           strftime()
           symlink()
           symlinkat() [Added in POSIX.1-2008]
           sync()
           syslog()
           tmpfile()
           tmpnam()
           ttyname()
           ttyname_r()
           tzset()
           ungetc()
           ungetwc()
           unlink()
           unlinkat() [Added in POSIX.1-2008]
           utime() [Added in POSIX.1-2008]
           utimensat() [Added in POSIX.1-2008]
           utimes() [Added in POSIX.1-2008]
           vdprintf() [Added in POSIX.1-2008]
           vfprintf()
           vfwprintf()
           vprintf()
           vwprintf()
           wcsftime()
           wordexp()
           wprintf()
           wscanf()

       An implementation may also mark other functions not specified in the standard as cancellation
       points.  In particular, an implementation is likely to mark any nonstandard function that may
       block as a cancellation point.  (This includes most functions that can touch files.)

       It  should  be noted that even if an application is not using asynchronous cancellation, that
       calling a function from the above list from an asynchronous  signal  handler  may  cause  the
       equivalent  of  asynchronous cancellation.  The underlying user code may not expect asynchro‐
       nous cancellation and the state of the user data may become inconsistent.  Therefore  signals
       should be used with caution when entering a region of deferred cancellation.

### Compiling on Linux
       On Linux, programs that use the Pthreads API should be compiled using _cc_ _-pthread_.

### Linux implementations of POSIX threads
       Over time, two threading implementations have been provided by the GNU C library on Linux:

### LinuxThreads
              This is the original Pthreads implementation.  Since glibc 2.4, this implementation is
              no longer supported.

       **NPTL** (Native POSIX Threads Library)
              This is the modern Pthreads implementation.  By  comparison  with  LinuxThreads,  NPTL
              provides  closer conformance to the requirements of the POSIX.1 specification and bet‐
              ter performance when creating large numbers of threads.  NPTL is available since glibc
              2.3.2, and requires features that are present in the Linux 2.6 kernel.

       Both  of  these  are so-called 1:1 implementations, meaning that each thread maps to a kernel
       scheduling entity.  Both threading implementations employ the Linux [**clone**(2)](https://www.chedong.com/phpMan.php/man/clone/2/markdown) system call.  In
       NPTL,  thread synchronization primitives (mutexes, thread joining, and so on) are implemented
       using the Linux [**futex**(2)](https://www.chedong.com/phpMan.php/man/futex/2/markdown) system call.

### LinuxThreads
       The notable features of this implementation are the following:

       -  In addition to the main (initial) thread, and the threads that the program  creates  using
          **pthread**___**[create**(3)](https://www.chedong.com/phpMan.php/man/create/3/markdown),  the  implementation  creates  a "manager" thread.  This thread handles
          thread creation and termination.  (Problems can result if  this  thread  is  inadvertently
          killed.)

       -  Signals  are  used  internally  by  the implementation.  On Linux 2.2 and later, the first
          three real-time signals are used (see also [**signal**(7)](https://www.chedong.com/phpMan.php/man/signal/7/markdown)).  On older  Linux  kernels,  **SIGUSR1**
          and  **SIGUSR2** are used.  Applications must avoid the use of whichever set of signals is em‐
          ployed by the implementation.

       -  Threads do not share process IDs.  (In effect, LinuxThreads  threads  are  implemented  as
          processes which share more information than usual, but which do not share a common process
          ID.)  LinuxThreads threads (including the manager thread) are  visible  as  separate  pro‐
          cesses using [**ps**(1)](https://www.chedong.com/phpMan.php/man/ps/1/markdown).

       The  LinuxThreads implementation deviates from the POSIX.1 specification in a number of ways,
       including the following:

       -  Calls to [**getpid**(2)](https://www.chedong.com/phpMan.php/man/getpid/2/markdown) return a different value in each thread.

       -  Calls to [**getppid**(2)](https://www.chedong.com/phpMan.php/man/getppid/2/markdown) in threads other than the main thread return the  process  ID  of  the
          manager  thread; instead [**getppid**(2)](https://www.chedong.com/phpMan.php/man/getppid/2/markdown) in these threads should return the same value as **getp**‐‐
          [**pid**(2)](https://www.chedong.com/phpMan.php/man/pid/2/markdown) in the main thread.

       -  When one thread creates a new child process using [**fork**(2)](https://www.chedong.com/phpMan.php/man/fork/2/markdown), any thread should  be  able  to
          [**wait**(2)](https://www.chedong.com/phpMan.php/man/wait/2/markdown) on the child.  However, the implementation allows only the thread that created the
          child to [**wait**(2)](https://www.chedong.com/phpMan.php/man/wait/2/markdown) on it.

       -  When a thread calls [**execve**(2)](https://www.chedong.com/phpMan.php/man/execve/2/markdown), all other threads are terminated (as required by  POSIX.1).
          However,  the  resulting  process has the same PID as the thread that called [**execve**(2)](https://www.chedong.com/phpMan.php/man/execve/2/markdown): it
          should have the same PID as the main thread.

       -  Threads do not share user and group IDs.  This can cause  complications  with  set-user-ID
          programs  and  can cause failures in Pthreads functions if an application changes its cre‐
          dentials using [**seteuid**(2)](https://www.chedong.com/phpMan.php/man/seteuid/2/markdown) or similar.

       -  Threads do not share a common session ID and process group ID.

       -  Threads do not share record locks created using [**fcntl**(2)](https://www.chedong.com/phpMan.php/man/fcntl/2/markdown).

       -  The information returned by [**times**(2)](https://www.chedong.com/phpMan.php/man/times/2/markdown) and [**getrusage**(2)](https://www.chedong.com/phpMan.php/man/getrusage/2/markdown) is per-thread rather  than  process-
          wide.

       -  Threads do not share semaphore undo values (see [**semop**(2)](https://www.chedong.com/phpMan.php/man/semop/2/markdown)).

       -  Threads do not share interval timers.

       -  Threads do not share a common nice value.

       -  POSIX.1  distinguishes  the notions of signals that are directed to the process as a whole
          and signals that are directed to individual threads.  According to POSIX.1, a  process-di‐
          rected signal (sent using [**kill**(2)](https://www.chedong.com/phpMan.php/man/kill/2/markdown), for example) should be handled by a single, arbitrarily
          selected thread within the process.  LinuxThreads does not support the notion of  process-
          directed signals: signals may be sent only to specific threads.

       -  Threads  have distinct alternate signal stack settings.  However, a new thread's alternate
          signal stack settings are copied from the thread that created it, so that the threads ini‐
          tially share an alternate signal stack.  (A new thread should start with no alternate sig‐
          nal stack defined.  If two threads handle signals on their shared alternate  signal  stack
          at the same time, unpredictable program failures are likely to occur.)

   **NPTL**
       With  NPTL,  all of the threads in a process are placed in the same thread group; all members
       of a thread group share the same PID.  NPTL does not employ a manager thread.

       NPTL makes internal use of the first two real-time signals; these signals cannot be  used  in
       applications.  See [**nptl**(7)](https://www.chedong.com/phpMan.php/man/nptl/7/markdown) for further details.

       NPTL still has at least one nonconformance with POSIX.1:

       -  Threads do not share a common nice value.

       Some NPTL nonconformances occur only with older kernels:

       -  The  information  returned by [**times**(2)](https://www.chedong.com/phpMan.php/man/times/2/markdown) and [**getrusage**(2)](https://www.chedong.com/phpMan.php/man/getrusage/2/markdown) is per-thread rather than process-
          wide (fixed in kernel 2.6.9).

       -  Threads do not share resource limits (fixed in kernel 2.6.10).

       -  Threads do not share interval timers (fixed in kernel 2.6.12).

       -  Only the main thread is permitted to start a new session using [**setsid**(2)](https://www.chedong.com/phpMan.php/man/setsid/2/markdown) (fixed in  kernel
          2.6.16).

       -  Only  the  main  thread is permitted to make the process into a process group leader using
          [**setpgid**(2)](https://www.chedong.com/phpMan.php/man/setpgid/2/markdown) (fixed in kernel 2.6.16).

       -  Threads have distinct alternate signal stack settings.  However, a new thread's  alternate
          signal stack settings are copied from the thread that created it, so that the threads ini‐
          tially share an alternate signal stack (fixed in kernel 2.6.16).

       Note the following further points about the NPTL implementation:

       -  If the stack size soft resource limit  (see  the  description  of  **RLIMIT**___**STACK**  in  **setr**‐‐
          [**limit**(2)](https://www.chedong.com/phpMan.php/man/limit/2/markdown))  is  set  to  a  value other than _unlimited_, then this value defines the default
          stack size for new threads.  To be effective, this limit must be set before the program is
          executed,  perhaps  using  the  _ulimit_ _-s_ shell built-in command (_limit_ _stacksize_ in the C
          shell).

### Determining the threading implementation
       Since glibc 2.3.2, the [**getconf**(1)](https://www.chedong.com/phpMan.php/man/getconf/1/markdown) command can be used to determine the system's threading im‐
       plementation, for example:

           bash$ getconf GNU_LIBPTHREAD_VERSION
           NPTL 2.3.4

       With  older glibc versions, a command such as the following should be sufficient to determine
       the default threading implementation:

           bash$ $( ldd /bin/ls | grep libc.so | awk '{print $3}' ) | \
                           egrep -i 'threads|nptl'
                   Native POSIX Threads Library by Ulrich Drepper et al

   **Selecting** **the** **threading** **implementation:** **LD**___**ASSUME**___**KERNEL**
       On systems with a glibc that supports both LinuxThreads and NPTL  (i.e.,  glibc  2.3._x_),  the
       **LD**___**ASSUME**___**KERNEL**  environment  variable  can be used to override the dynamic linker's default
       choice of threading implementation.  This variable tells the dynamic linker to assume that it
       is  running  on top of a particular kernel version.  By specifying a kernel version that does
       not provide the support required by NPTL, we can force the use of  LinuxThreads.   (The  most
       likely reason for doing this is to run a (broken) application that depends on some nonconfor‐
       mant behavior in LinuxThreads.)  For example:

           bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \
                           awk '{print $3}' ) | egrep -i 'threads|nptl'
                   linuxthreads-0.10 by Xavier Leroy

## SEE ALSO
       [**clone**(2)](https://www.chedong.com/phpMan.php/man/clone/2/markdown), [**fork**(2)](https://www.chedong.com/phpMan.php/man/fork/2/markdown), [**futex**(2)](https://www.chedong.com/phpMan.php/man/futex/2/markdown), [**gettid**(2)](https://www.chedong.com/phpMan.php/man/gettid/2/markdown), [**proc**(5)](https://www.chedong.com/phpMan.php/man/proc/5/markdown), [**attributes**(7)](https://www.chedong.com/phpMan.php/man/attributes/7/markdown), [**futex**(7)](https://www.chedong.com/phpMan.php/man/futex/7/markdown), [**nptl**(7)](https://www.chedong.com/phpMan.php/man/nptl/7/markdown),
       [**sigevent**(7)](https://www.chedong.com/phpMan.php/man/sigevent/7/markdown), [**signal**(7)](https://www.chedong.com/phpMan.php/man/signal/7/markdown)

       Various Pthreads manual pages, for example: **pthread**___**[atfork**(3)](https://www.chedong.com/phpMan.php/man/atfork/3/markdown), **pthread**___**attr**___**[init**(3)](https://www.chedong.com/phpMan.php/man/init/3/markdown),
       **pthread**___**[cancel**(3)](https://www.chedong.com/phpMan.php/man/cancel/3/markdown), **pthread**___**cleanup**___**[push**(3)](https://www.chedong.com/phpMan.php/man/push/3/markdown), **pthread**___**cond**___**[signal**(3)](https://www.chedong.com/phpMan.php/man/signal/3/markdown), **pthread**___**cond**___**[wait**(3)](https://www.chedong.com/phpMan.php/man/wait/3/markdown),
       **pthread**___**[create**(3)](https://www.chedong.com/phpMan.php/man/create/3/markdown), **pthread**___**[detach**(3)](https://www.chedong.com/phpMan.php/man/detach/3/markdown), **pthread**___**[equal**(3)](https://www.chedong.com/phpMan.php/man/equal/3/markdown), **pthread**___**[exit**(3)](https://www.chedong.com/phpMan.php/man/exit/3/markdown),
       **pthread**___**key**___**[create**(3)](https://www.chedong.com/phpMan.php/man/create/3/markdown), **pthread**___**[kill**(3)](https://www.chedong.com/phpMan.php/man/kill/3/markdown), **pthread**___**mutex**___**[lock**(3)](https://www.chedong.com/phpMan.php/man/lock/3/markdown), **pthread**___**mutex**___**[unlock**(3)](https://www.chedong.com/phpMan.php/man/unlock/3/markdown),
       **pthread**___**mutexattr**___**[destroy**(3)](https://www.chedong.com/phpMan.php/man/destroy/3/markdown), **pthread**___**mutexattr**___**[init**(3)](https://www.chedong.com/phpMan.php/man/init/3/markdown), **pthread**___**[once**(3)](https://www.chedong.com/phpMan.php/man/once/3/markdown),
       **pthread**___**spin**___**[init**(3)](https://www.chedong.com/phpMan.php/man/init/3/markdown), **pthread**___**spin**___**[lock**(3)](https://www.chedong.com/phpMan.php/man/lock/3/markdown), **pthread**___**rwlockattr**___**setkind**___**[np**(3)](https://www.chedong.com/phpMan.php/man/np/3/markdown),
       **pthread**___**[setcancelstate**(3)](https://www.chedong.com/phpMan.php/man/setcancelstate/3/markdown), **pthread**___**[setcanceltype**(3)](https://www.chedong.com/phpMan.php/man/setcanceltype/3/markdown), **pthread**___**[setspecific**(3)](https://www.chedong.com/phpMan.php/man/setspecific/3/markdown),
       **pthread**___**[sigmask**(3)](https://www.chedong.com/phpMan.php/man/sigmask/3/markdown), **pthread**___**[sigqueue**(3)](https://www.chedong.com/phpMan.php/man/sigqueue/3/markdown), and **pthread**___**[testcancel**(3)](https://www.chedong.com/phpMan.php/man/testcancel/3/markdown)

## COLOPHON
       This page is part of release 5.10 of the Linux _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/>.



Linux                                        2020-12-21                                  [PTHREADS(7)](https://www.chedong.com/phpMan.php/man/PTHREADS/7/markdown)
