Blame sysdeps/htl/pthread.h

Packit 6c4009
/* Posix threads.  Hurd version.
Packit 6c4009
   Copyright (C) 2000-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library;  if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 *	POSIX Threads Extension: ???			<pthread.h>
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef _PTHREAD_H
Packit 6c4009
#define _PTHREAD_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
#include <sys/cdefs.h>
Packit 6c4009
#ifndef __extern_inline
Packit 6c4009
/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
Packit 6c4009
   inline semantics, unless -fgnu89-inline is used.  */
Packit 6c4009
# if !defined __cplusplus || __GNUC_PREREQ (4,3)
Packit 6c4009
#  if defined __GNUC_STDC_INLINE__ || defined __cplusplus
Packit 6c4009
#   define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
Packit 6c4009
#   if __GNUC_PREREQ (4,3)
Packit 6c4009
#    define __extern_always_inline \
Packit 6c4009
   extern __always_inline __attribute__ ((__gnu_inline__, __artificial__))
Packit 6c4009
#   else
Packit 6c4009
#    define __extern_always_inline \
Packit 6c4009
   extern __always_inline __attribute__ ((__gnu_inline__))
Packit 6c4009
#   endif
Packit 6c4009
#  else
Packit 6c4009
#   define __extern_inline extern __inline
Packit 6c4009
#   define __extern_always_inline extern __always_inline
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#include <sched.h>
Packit 6c4009
#include <time.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
#include <bits/pthreadtypes.h>
Packit 6c4009
Packit 6c4009
#include <bits/pthread.h>
Packit 6c4009
Packit 6c4009
/* Possible values for the process shared attribute.  */
Packit 6c4009
#define PTHREAD_PROCESS_PRIVATE __PTHREAD_PROCESS_PRIVATE
Packit 6c4009
#define PTHREAD_PROCESS_SHARED __PTHREAD_PROCESS_SHARED
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Thread attributes.  */
Packit 6c4009
Packit 6c4009
/* Possible values for the inheritsched attribute.  */
Packit 6c4009
#define PTHREAD_EXPLICIT_SCHED __PTHREAD_EXPLICIT_SCHED
Packit 6c4009
#define PTHREAD_INHERIT_SCHED __PTHREAD_INHERIT_SCHED
Packit 6c4009
Packit 6c4009
/* Possible values for the `contentionscope' attribute.  */
Packit 6c4009
#define PTHREAD_SCOPE_SYSTEM __PTHREAD_SCOPE_SYSTEM
Packit 6c4009
#define PTHREAD_SCOPE_PROCESS __PTHREAD_SCOPE_PROCESS
Packit 6c4009
Packit 6c4009
/* Possible values for the `detachstate' attribute.  */
Packit 6c4009
#define PTHREAD_CREATE_JOINABLE __PTHREAD_CREATE_JOINABLE
Packit 6c4009
#define PTHREAD_CREATE_DETACHED __PTHREAD_CREATE_DETACHED
Packit 6c4009
Packit 6c4009
#include <bits/types/struct___pthread_attr.h>
Packit 6c4009
Packit 6c4009
/* Initialize the thread attribute object in *ATTR to the default
Packit 6c4009
   values.  */
Packit 6c4009
extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Destroy the thread attribute object in *ATTR.  */
Packit 6c4009
extern int pthread_attr_destroy (pthread_attr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the inheritsched attribute in *ATTR in
Packit 6c4009
   *INHERITSCHED.  */
Packit 6c4009
extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr,
Packit 6c4009
					 int *__restrict __inheritsched)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the inheritsched attribute in *ATTR to
Packit 6c4009
   INHERITSCHED.  */
Packit 6c4009
extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
Packit 6c4009
					 int __inheritsched)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the schedparam attribute in *ATTR in *PARAM.  */
Packit 6c4009
extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
Packit 6c4009
				       struct sched_param *__restrict __param)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the schedparam attribute in *ATTR to PARAM.  */
Packit 6c4009
extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
Packit 6c4009
				       const struct sched_param *__restrict
Packit 6c4009
				       __param) __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the schedpolicy attribute in *ATTR to *POLICY.  */
Packit 6c4009
extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr,
Packit 6c4009
					int *__restrict __policy)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the schedpolicy attribute in *ATTR to POLICY.  */
Packit 6c4009
extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr,
Packit 6c4009
					int __policy)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the contentionscope attribute in *ATTR in
Packit 6c4009
   *CONTENTIONSCOPE.  */
Packit 6c4009
extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr,
Packit 6c4009
				  int *__restrict __contentionscope)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the contentionscope attribute in *ATTR to
Packit 6c4009
   CONTENTIONSCOPE.  */
Packit 6c4009
extern int pthread_attr_setscope (pthread_attr_t *__attr,
Packit 6c4009
				  int __contentionscope)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the stackaddr attribute in *ATTR in
Packit 6c4009
   *STACKADDR.  */
Packit 6c4009
extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr,
Packit 6c4009
				      void **__restrict __stackaddr)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the stackaddr attribute in *ATTR to STACKADDR.  */
Packit 6c4009
extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
Packit 6c4009
				      void *__stackaddr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Return the value of the stackaddr and stacksize attributes in *ATTR
Packit 6c4009
   in *STACKADDR and *STACKSIZE respectively.  */
Packit 6c4009
extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
Packit 6c4009
				  void **__restrict __stackaddr,
Packit 6c4009
				  size_t *__restrict __stacksize)
Packit 6c4009
	__THROW __nonnull ((1, 2, 3));
Packit 6c4009
Packit 6c4009
/* Set the value of the stackaddr and stacksize attributes in *ATTR to
Packit 6c4009
   STACKADDR and STACKSIZE respectively.  */
Packit 6c4009
extern int pthread_attr_setstack (pthread_attr_t *__attr,
Packit 6c4009
				  void *__stackaddr,
Packit 6c4009
				  size_t __stacksize)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the detachstate attribute in *ATTR in
Packit 6c4009
   *DETACHSTATE.  */
Packit 6c4009
extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr,
Packit 6c4009
					int *__detachstate)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the detachstate attribute in *ATTR to
Packit 6c4009
   DETACHSTATE.  */
Packit 6c4009
extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
Packit 6c4009
					int __detachstate)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the guardsize attribute in *ATTR in
Packit 6c4009
   *GUARDSIZE.  */
Packit 6c4009
extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict __attr,
Packit 6c4009
				      size_t *__restrict __guardsize)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the guardsize attribute in *ATTR to GUARDSIZE.  */
Packit 6c4009
extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
Packit 6c4009
				      size_t __guardsize)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the stacksize attribute in *ATTR in
Packit 6c4009
   *STACKSIZE.  */
Packit 6c4009
extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr,
Packit 6c4009
				      size_t *__restrict __stacksize)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the stacksize attribute in *ATTR to STACKSIZE.  */
Packit 6c4009
extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
Packit 6c4009
				      size_t __stacksize)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Initialize thread attribute *ATTR with attributes corresponding to the
Packit 6c4009
   already running thread THREAD.  It shall be called on an uninitialized ATTR
Packit 6c4009
   and destroyed with pthread_attr_destroy when no longer needed.  */
Packit 6c4009
extern int pthread_getattr_np (pthread_t __thr, pthread_attr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((2));
Packit 6c4009
#endif
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Create a thread with attributes given by ATTR, executing
Packit 6c4009
   START_ROUTINE with argument ARG.  */
Packit 6c4009
extern int pthread_create (pthread_t *__restrict __threadp,
Packit 6c4009
			   __const pthread_attr_t *__restrict __attr,
Packit 6c4009
			   void *(*__start_routine)(void *),
Packit 6c4009
			   void *__restrict __arg) __THROWNL __nonnull ((1, 3));
Packit 6c4009
Packit 6c4009
/* Terminate the current thread and make STATUS available to any
Packit 6c4009
   thread that might join us.  */
Packit 6c4009
extern void pthread_exit (void *__status) __attribute__ ((__noreturn__));
Packit 6c4009
Packit 6c4009
/* Make calling thread wait for termination of thread THREAD.  Return
Packit 6c4009
   the exit status of the thread in *STATUS.  */
Packit 6c4009
extern int pthread_join (pthread_t __threadp, void **__status);
Packit 6c4009
Packit 6c4009
/* Indicate that the storage for THREAD can be reclaimed when it
Packit 6c4009
   terminates.  */
Packit 6c4009
extern int pthread_detach (pthread_t __threadp);
Packit 6c4009
Packit 6c4009
/* Compare thread IDs T1 and T2.  Return nonzero if they are equal, 0
Packit 6c4009
   if they are not.  */
Packit 6c4009
extern int pthread_equal (pthread_t __t1, pthread_t __t2);
Packit 6c4009
Packit 6c4009
#ifdef __USE_EXTERN_INLINES
Packit 6c4009
Packit 6c4009
__extern_inline int
Packit 6c4009
pthread_equal (pthread_t __t1, pthread_t __t2)
Packit 6c4009
{
Packit 6c4009
  return __pthread_equal (__t1, __t2);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
#endif /* Use extern inlines.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the thread ID of the calling thread.  */
Packit 6c4009
extern pthread_t pthread_self (void) __THROW;
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Mutex attributes.  */
Packit 6c4009
Packit 6c4009
#define PTHREAD_PRIO_NONE_NP __PTHREAD_PRIO_NONE
Packit 6c4009
#define PTHREAD_PRIO_INHERIT_NP __PTHREAD_PRIO_INHERIT
Packit 6c4009
#define PTHREAD_PRIO_PROTECT_NP __PTHREAD_PRIO_PROTECT
Packit 6c4009
#ifdef __USE_UNIX98
Packit 6c4009
# define PTHREAD_PRIO_NONE PTHREAD_PRIO_NONE_NP
Packit 6c4009
# define PTHREAD_PRIO_INHERIT PTHREAD_PRIO_INHERIT_NP
Packit 6c4009
# define PTHREAD_PRIO_PROTECT PTHREAD_PRIO_PROTECT_NP
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#define PTHREAD_MUTEX_TIMED_NP __PTHREAD_MUTEX_TIMED
Packit 6c4009
#define PTHREAD_MUTEX_ERRORCHECK_NP __PTHREAD_MUTEX_ERRORCHECK
Packit 6c4009
#define PTHREAD_MUTEX_RECURSIVE_NP __PTHREAD_MUTEX_RECURSIVE
Packit 6c4009
#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
Packit 6c4009
# define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_TIMED_NP
Packit 6c4009
# define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP
Packit 6c4009
# define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
Packit 6c4009
# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
Packit 6c4009
#endif
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* For compatibility.  */
Packit 6c4009
# define PTHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_TIMED_NP
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
# define PTHREAD_MUTEX_STALLED __PTHREAD_MUTEX_STALLED
Packit 6c4009
# define PTHREAD_MUTEX_ROBUST __PTHREAD_MUTEX_ROBUST
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#include <bits/types/struct___pthread_mutexattr.h>
Packit 6c4009
Packit 6c4009
/* Initialize the mutex attribute object in *ATTR to the default
Packit 6c4009
   values.  */
Packit 6c4009
extern int pthread_mutexattr_init(pthread_mutexattr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Destroy the mutex attribute structure in *ATTR.  */
Packit 6c4009
extern int pthread_mutexattr_destroy(pthread_mutexattr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_UNIX98
Packit 6c4009
/* Return the value of the prioceiling attribute in *ATTR in
Packit 6c4009
   *PRIOCEILING.  */
Packit 6c4009
extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict __attr,
Packit 6c4009
					    int *__restrict __prioceiling)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the prioceiling attribute in *ATTR to
Packit 6c4009
   PRIOCEILING.  */
Packit 6c4009
extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *__attr,
Packit 6c4009
					    int __prioceiling)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the protocol attribute in *ATTR in
Packit 6c4009
   *PROTOCOL.  */
Packit 6c4009
extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict __attr,
Packit 6c4009
					 int *__restrict __protocol)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the protocol attribute in *ATTR to PROTOCOL.  */
Packit 6c4009
extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *__attr,
Packit 6c4009
					 int __protocol)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Get the robustness flag of the mutex attribute ATTR.  */
Packit 6c4009
extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
Packit 6c4009
					int *__robustness)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
# ifdef __USE_GNU
Packit 6c4009
extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr,
Packit 6c4009
					   int *__robustness)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
/* Set the robustness flag of the mutex attribute ATTR.  */
Packit 6c4009
extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
Packit 6c4009
					int __robustness)
Packit 6c4009
     __THROW __nonnull ((1));
Packit 6c4009
# ifdef __USE_GNU
Packit 6c4009
extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
Packit 6c4009
					   int __robustness)
Packit 6c4009
     __THROW __nonnull ((1));
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the process shared attribute in *ATTR in
Packit 6c4009
   *PSHARED.  */
Packit 6c4009
extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr,
Packit 6c4009
					int *__restrict __pshared)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the process shared attribute in *ATTR to
Packit 6c4009
   PSHARED.  */
Packit 6c4009
extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr,
Packit 6c4009
					int __pshared)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
Packit 6c4009
/* Return the value of the type attribute in *ATTR in *TYPE.  */
Packit 6c4009
extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict __attr,
Packit 6c4009
				     int *__restrict __type)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the type attribute in *ATTR to TYPE.  */
Packit 6c4009
extern int pthread_mutexattr_settype(pthread_mutexattr_t *__attr,
Packit 6c4009
				     int __type)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Mutexes.  */
Packit 6c4009
Packit 6c4009
#include <bits/types/struct___pthread_mutex.h>
Packit 6c4009
Packit 6c4009
#define PTHREAD_MUTEX_INITIALIZER __PTHREAD_MUTEX_INITIALIZER
Packit 6c4009
/* Static initializer for recursive mutexes.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
Packit 6c4009
  __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
Packit 6c4009
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
Packit 6c4009
  __PTHREAD_RECURSIVE_MUTEX_INITIALIZER
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Create a mutex with attributes given by ATTR and store it in
Packit 6c4009
   *__MUTEX.  */
Packit 6c4009
extern int pthread_mutex_init (struct __pthread_mutex *__restrict __mutex,
Packit 6c4009
			       const pthread_mutexattr_t *__restrict __attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Destroy the mutex __MUTEX.  */
Packit 6c4009
extern int pthread_mutex_destroy (struct __pthread_mutex *__mutex)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Wait until lock for MUTEX becomes available and lock it.  */
Packit 6c4009
extern int pthread_mutex_lock (pthread_mutex_t *__mutex);
Packit 6c4009
Packit 6c4009
/* Try to lock MUTEX.  */
Packit 6c4009
extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Try to lock MUTEX, block until *ABSTIME if it is already held.  */
Packit 6c4009
extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict __mutex,
Packit 6c4009
				    const struct timespec *__restrict __abstime)
Packit 6c4009
	__THROWNL __nonnull ((1, 2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Unlock MUTEX.  */
Packit 6c4009
extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Transfer ownership of the mutex MUTEX to the thread TID.  The
Packit 6c4009
   caller must own the lock.  */
Packit 6c4009
extern int __pthread_mutex_transfer_np (struct __pthread_mutex *__mutex,
Packit 6c4009
					pthread_t __tid)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_UNIX98
Packit 6c4009
/* Return the priority ceiling of mutex *MUTEX in *PRIOCEILING.  */
Packit 6c4009
extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict __mutex,
Packit 6c4009
					 int *__restrict __prioceiling)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* After acquiring the mutex *MUTEX, set its priority ceiling to PRIO
Packit 6c4009
   and return the old priority ceiling in *OLDPRIO.  Before returning,
Packit 6c4009
   release the mutex.  */
Packit 6c4009
extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
Packit 6c4009
					 int __prio, int *__restrict __oldprio)
Packit 6c4009
	__THROW __nonnull ((1, 3));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K8
Packit 6c4009
Packit 6c4009
/* Declare the state protected by robust mutex MTXP as consistent. */
Packit 6c4009
extern int pthread_mutex_consistent (pthread_mutex_t *__mtxp)
Packit 6c4009
  __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
#  ifdef __USE_GNU
Packit 6c4009
extern int pthread_mutex_consistent_np (pthread_mutex_t *__mtxp)
Packit 6c4009
  __THROW __nonnull ((1));
Packit 6c4009
#  endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Condition attributes.  */
Packit 6c4009
Packit 6c4009
#include <bits/types/struct___pthread_condattr.h>
Packit 6c4009
Packit 6c4009
/* Initialize the condition attribute in *ATTR to the default
Packit 6c4009
   values.  */
Packit 6c4009
extern int pthread_condattr_init (pthread_condattr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Destroy the condition attribute structure in *ATTR.  */
Packit 6c4009
extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Return the value of the clock attribute in *ATTR in *CLOCK_ID.  */
Packit 6c4009
extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict __attr,
Packit 6c4009
				      __clockid_t *__restrict __clock_id)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the clock attribute in *ATTR to CLOCK_ID.  */
Packit 6c4009
extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
Packit 6c4009
				      __clockid_t __clock_id)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the process shared attribute in *ATTR in
Packit 6c4009
   *PSHARED.  */
Packit 6c4009
extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict __attr,
Packit 6c4009
					int *__restrict __pshared)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the process shared attribute in *ATTR to
Packit 6c4009
   PSHARED.  */
Packit 6c4009
extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
Packit 6c4009
					int __pshared)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Condition variables.  */
Packit 6c4009
Packit 6c4009
#include <bits/types/struct___pthread_cond.h>
Packit 6c4009
Packit 6c4009
#define PTHREAD_COND_INITIALIZER __PTHREAD_COND_INITIALIZER
Packit 6c4009
Packit 6c4009
extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
Packit 6c4009
			      const pthread_condattr_t *__restrict __attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
extern int pthread_cond_destroy (pthread_cond_t *__cond)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Unblock at least one of the threads that are blocked on condition
Packit 6c4009
   variable COND.  */
Packit 6c4009
extern int pthread_cond_signal (pthread_cond_t *__cond)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Unblock all threads that are blocked on condition variable COND.  */
Packit 6c4009
extern int pthread_cond_broadcast (pthread_cond_t *__cond)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Block on condition variable COND.  MUTEX should be held by the
Packit 6c4009
   calling thread.  On success, MUTEX will be held by the calling
Packit 6c4009
   thread.  */
Packit 6c4009
extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
Packit 6c4009
			      pthread_mutex_t *__restrict __mutex)
Packit 6c4009
	 __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Block on condition variable COND.  MUTEX should be held by the
Packit 6c4009
   calling thread. On success, MUTEX will be held by the calling
Packit 6c4009
   thread.  If the time specified by ABSTIME passes, ETIMEDOUT is
Packit 6c4009
   returned, and MUTEX will nevertheless be held.  */
Packit 6c4009
extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
Packit 6c4009
				   pthread_mutex_t *__restrict __mutex,
Packit 6c4009
				   __const struct timespec *__restrict __abstime)
Packit 6c4009
	 __nonnull ((1, 2, 3));
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Spin locks.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
Packit 6c4009
# include <bits/types/__pthread_spinlock_t.h>
Packit 6c4009
Packit 6c4009
# define PTHREAD_SPINLOCK_INITIALIZER __PTHREAD_SPIN_LOCK_INITIALIZER
Packit 6c4009
Packit 6c4009
/* Destroy the spin lock object LOCK.  */
Packit 6c4009
extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
Packit 6c4009
	__nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Initialize the spin lock object LOCK.  PSHARED determines whether
Packit 6c4009
   the spin lock can be operated upon by multiple processes.  */
Packit 6c4009
extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
Packit 6c4009
	__nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Lock the spin lock object LOCK.  If the lock is held by another
Packit 6c4009
   thread spin until it becomes available.  */
Packit 6c4009
extern int pthread_spin_lock (pthread_spinlock_t *__lock)
Packit 6c4009
	__nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Lock the spin lock object LOCK.  Fail if the lock is held by
Packit 6c4009
   another thread.  */
Packit 6c4009
extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
Packit 6c4009
	__nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Unlock the spin lock object LOCK.  */
Packit 6c4009
extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
Packit 6c4009
	__nonnull ((1));
Packit 6c4009
Packit 6c4009
# if defined __USE_EXTERN_INLINES && defined _LIBC
Packit 6c4009
Packit 6c4009
# include <bits/spin-lock-inline.h>
Packit 6c4009
Packit 6c4009
__extern_inline int
Packit 6c4009
pthread_spin_destroy (pthread_spinlock_t *__lock)
Packit 6c4009
{
Packit 6c4009
  return __pthread_spin_destroy (__lock);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
__extern_inline int
Packit 6c4009
pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
Packit 6c4009
{
Packit 6c4009
  return __pthread_spin_init (__lock, __pshared);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
__extern_inline int
Packit 6c4009
pthread_spin_lock (pthread_spinlock_t *__lock)
Packit 6c4009
{
Packit 6c4009
  return __pthread_spin_lock (__lock);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
__extern_inline int
Packit 6c4009
pthread_spin_trylock (pthread_spinlock_t *__lock)
Packit 6c4009
{
Packit 6c4009
  return __pthread_spin_trylock (__lock);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
__extern_inline int
Packit 6c4009
pthread_spin_unlock (pthread_spinlock_t *__lock)
Packit 6c4009
{
Packit 6c4009
  return __pthread_spin_unlock (__lock);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
# endif /* Use extern inlines.  */
Packit 6c4009
Packit 6c4009
#endif /* XPG6.  */
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* rwlock attributes.  */
Packit 6c4009
Packit 6c4009
#if defined __USE_UNIX98 || defined __USE_XOPEN2K
Packit 6c4009
Packit 6c4009
# include <bits/types/struct___pthread_rwlockattr.h>
Packit 6c4009
Packit 6c4009
/* Initialize rwlock attribute object in *ATTR to the default
Packit 6c4009
   values.  */
Packit 6c4009
extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Destroy the rwlock attribute object in *ATTR.  */
Packit 6c4009
extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the process shared attribute in *ATTR in
Packit 6c4009
   *PSHARED.  */
Packit 6c4009
extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict __attr,
Packit 6c4009
					  int *__restrict __pshared)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the process shared atrribute in *ATTR to
Packit 6c4009
   PSHARED.  */
Packit 6c4009
extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
Packit 6c4009
					  int __pshared)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Return current setting of reader/writer preference.  */
Packit 6c4009
extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t *
Packit 6c4009
					  __restrict __attr,
Packit 6c4009
					  int *__restrict __pref)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set reader/write preference.  */
Packit 6c4009
extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
Packit 6c4009
					  int __pref) __THROW __nonnull ((1));
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* rwlocks.  */
Packit 6c4009
Packit 6c4009
# include <bits/types/struct___pthread_rwlock.h>
Packit 6c4009
Packit 6c4009
# define PTHREAD_RWLOCK_INITIALIZER __PTHREAD_RWLOCK_INITIALIZER
Packit 6c4009
/* Create a rwlock object with attributes given by ATTR and strore the
Packit 6c4009
   result in *RWLOCK.  */
Packit 6c4009
extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
Packit 6c4009
				const pthread_rwlockattr_t *__restrict __attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Destroy the rwlock *RWLOCK.  */
Packit 6c4009
extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Acquire the rwlock *RWLOCK for reading.  */
Packit 6c4009
extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Acquire the rwlock *RWLOCK for reading.  */
Packit 6c4009
extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
# ifdef __USE_XOPEN2K
Packit 6c4009
/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if
Packit 6c4009
   it is already held.  */
Packit 6c4009
extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict __rwlock,
Packit 6c4009
				       const struct timespec *__restrict __abstime)
Packit 6c4009
	__THROWNL __nonnull ((1, 2));
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
/* Acquire the rwlock *RWLOCK for writing.  */
Packit 6c4009
extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Try to acquire the rwlock *RWLOCK for writing.  */
Packit 6c4009
extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
# ifdef __USE_XOPEN2K
Packit 6c4009
/* Acquire the rwlock *RWLOCK for writing blocking until *ABSTIME if
Packit 6c4009
   it is already held.  */
Packit 6c4009
extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict __rwlock,
Packit 6c4009
				       const struct timespec *__restrict __abstime)
Packit 6c4009
	__THROWNL __nonnull ((1, 2));
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
/* Release the lock held by the current thread on *RWLOCK.  */
Packit 6c4009
extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
#endif /* __USE_UNIX98 || __USE_XOPEN2K */
Packit 6c4009
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Cancelation.  */
Packit 6c4009
Packit 6c4009
/* Register a cleanup handler.  */
Packit 6c4009
extern void pthread_cleanup_push (void (*__routine) (void *), void *__arg);
Packit 6c4009
Packit 6c4009
/* Unregister a cleanup handler.  */
Packit 6c4009
extern void pthread_cleanup_pop (int __execute);
Packit 6c4009
Packit 6c4009
#include <bits/cancelation.h>
Packit 6c4009
Packit 6c4009
#define pthread_cleanup_push(rt, rtarg) __pthread_cleanup_push(rt, rtarg)
Packit 6c4009
#define pthread_cleanup_pop(execute) __pthread_cleanup_pop(execute)
Packit 6c4009
Packit 6c4009
#define PTHREAD_CANCEL_DISABLE 0
Packit 6c4009
#define PTHREAD_CANCEL_ENABLE 1
Packit 6c4009
Packit 6c4009
/* Return the calling thread's cancelation state in *OLDSTATE and set
Packit 6c4009
   its state to STATE.  */
Packit 6c4009
extern int pthread_setcancelstate (int __state, int *__oldstate);
Packit 6c4009
Packit 6c4009
#define PTHREAD_CANCEL_DEFERRED 0
Packit 6c4009
#define PTHREAD_CANCEL_ASYNCHRONOUS 1
Packit 6c4009
Packit 6c4009
/* Return the calling thread's cancelation type in *OLDTYPE and set
Packit 6c4009
   its type to TYPE.  */
Packit 6c4009
extern int pthread_setcanceltype (int __type, int *__oldtype);
Packit 6c4009
Packit 6c4009
/* Value returned by pthread_join if the target thread was
Packit 6c4009
   canceled.  */
Packit 6c4009
#define PTHREAD_CANCELED ((void *) -1)
Packit 6c4009
Packit 6c4009
/* Cancel THEAD.  */
Packit 6c4009
extern int pthread_cancel (pthread_t __thr);
Packit 6c4009
Packit 6c4009
/* Add an explicit cancelation point.  */
Packit 6c4009
extern void pthread_testcancel (void);
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Barriers attributes.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
Packit 6c4009
# include <bits/types/struct___pthread_barrierattr.h>
Packit 6c4009
Packit 6c4009
/* Initialize barrier attribute object in *ATTR to the default
Packit 6c4009
   values.  */
Packit 6c4009
extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Destroy the barrier attribute object in *ATTR.  */
Packit 6c4009
extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the value of the process shared attribute in *ATTR in
Packit 6c4009
   *PSHARED.  */
Packit 6c4009
extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict __attr,
Packit 6c4009
					   int *__restrict __pshared)
Packit 6c4009
	__THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Set the value of the process shared atrribute in *ATTR to
Packit 6c4009
   PSHARED.  */
Packit 6c4009
extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
Packit 6c4009
					   int __pshared)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Barriers.  */
Packit 6c4009
Packit 6c4009
# include <bits/types/struct___pthread_barrier.h>
Packit 6c4009
Packit 6c4009
/* Returned by pthread_barrier_wait to exactly one thread each time a
Packit 6c4009
   barrier is passed.  */
Packit 6c4009
# define PTHREAD_BARRIER_SERIAL_THREAD -1
Packit 6c4009
Packit 6c4009
/* Initialize barrier BARRIER.  */
Packit 6c4009
extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
Packit 6c4009
				const pthread_barrierattr_t *__restrict __attr,
Packit 6c4009
				unsigned __count)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Destroy barrier BARRIER.  */
Packit 6c4009
extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Wait on barrier BARRIER.  */
Packit 6c4009
extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
Packit 6c4009
	__THROWNL __nonnull ((1));
Packit 6c4009
Packit 6c4009
#endif /* __USE_XOPEN2K */
Packit 6c4009
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Thread specific data.  */
Packit 6c4009
Packit 6c4009
#include <bits/types/__pthread_key.h>
Packit 6c4009
Packit 6c4009
/* Create a thread specific data key in KEY visible to all threads.
Packit 6c4009
   On thread destruction, DESTRUCTOR shall be called with the thread
Packit 6c4009
   specific data associate with KEY if it is not NULL.  */
Packit 6c4009
extern int pthread_key_create (pthread_key_t *__key,
Packit 6c4009
			       void (*__destructor) (void *))
Packit 6c4009
	__THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Delete the thread specific data key KEY.  The associated destructor
Packit 6c4009
   function is not called.  */
Packit 6c4009
extern int pthread_key_delete (pthread_key_t __key) __THROW;
Packit 6c4009
Packit 6c4009
/* Return the caller thread's thread specific value of KEY.  */
Packit 6c4009
extern void *pthread_getspecific (pthread_key_t __key) __THROW;
Packit 6c4009
Packit 6c4009
/* Set the caller thread's thread specific value of KEY to VALUE.  */
Packit 6c4009
extern int pthread_setspecific (pthread_key_t __key, const void *__value)
Packit 6c4009
	__THROW;
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Dynamic package initialization.  */
Packit 6c4009
Packit 6c4009
#include <bits/types/struct___pthread_once.h>
Packit 6c4009
Packit 6c4009
#define PTHREAD_ONCE_INIT __PTHREAD_ONCE_INIT
Packit 6c4009
Packit 6c4009
/* Call INIT_ROUTINE if this function has never been called with
Packit 6c4009
   *ONCE_CONTROL, otherwise do nothing.  */
Packit 6c4009
extern int pthread_once (pthread_once_t *__once_control,
Packit 6c4009
			 void (*__init_routine) (void)) __nonnull ((1, 2));
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Concurrency.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_UNIX98
Packit 6c4009
/* Set the desired concurrency level to NEW_LEVEL.  */
Packit 6c4009
extern int pthread_setconcurrency (int __new_level) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the current concurrency level.  */
Packit 6c4009
extern int pthread_getconcurrency (void) __THROW;
Packit 6c4009
#endif
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Forking.  */
Packit 6c4009
Packit 6c4009
/* Register the function PREPARE to be run before the process forks,
Packit 6c4009
   the function PARENT to be run after a fork in the parent and the
Packit 6c4009
   function CHILD to be run in the child after the fork.  If no
Packit 6c4009
   handling is desired then any of PREPARE, PARENT and CHILD may be
Packit 6c4009
   NULL.  The prepare handles will be called in the reverse order
Packit 6c4009
   which they were registered and the parent and child handlers in the
Packit 6c4009
   order in which they were registered.  */
Packit 6c4009
extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void),
Packit 6c4009
			   void (*__child) (void)) __THROW;
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Signals (should be in <signal.h>).  */
Packit 6c4009
Packit 6c4009
/* Send signal SIGNO to thread THREAD.  */
Packit 6c4009
extern int pthread_kill (pthread_t __thr, int __signo) __THROW;
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Time.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Return the thread cpu clock.  */
Packit 6c4009
extern int pthread_getcpuclockid (pthread_t __thr, __clockid_t *__clock)
Packit 6c4009
	__THROW __nonnull ((2));
Packit 6c4009
#endif
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Scheduling.  */
Packit 6c4009
Packit 6c4009
/* Return thread THREAD's scheduling paramters.  */
Packit 6c4009
extern int pthread_getschedparam (pthread_t __thr, int *__restrict __policy,
Packit 6c4009
				  struct sched_param *__restrict __param)
Packit 6c4009
	__THROW __nonnull ((2, 3));
Packit 6c4009
Packit 6c4009
/* Set thread THREAD's scheduling paramters.  */
Packit 6c4009
extern int pthread_setschedparam (pthread_t __thr, int __policy,
Packit 6c4009
				  const struct sched_param *__param)
Packit 6c4009
	__THROW __nonnull ((3));
Packit 6c4009
Packit 6c4009
/* Set thread THREAD's scheduling priority.  */
Packit 6c4009
extern int pthread_setschedprio (pthread_t __thr, int __prio) __THROW;
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Yield the processor to another thread or process.
Packit 6c4009
   This function is similar to the POSIX `sched_yield' function but
Packit 6c4009
   might be differently implemented in the case of a m-on-n thread
Packit 6c4009
   implementation.  */
Packit 6c4009
extern int pthread_yield (void) __THROW;
Packit 6c4009
#endif
Packit 6c4009

Packit 6c4009
Packit 6c4009
/* Kernel-specific interfaces.  */
Packit 6c4009
Packit 6c4009
#include <bits/pthread-np.h>
Packit 6c4009
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* pthread.h */