Blame sysdeps/nptl/pthread-functions.h

Packit 6c4009
/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
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
#ifndef _PTHREAD_FUNCTIONS_H
Packit 6c4009
#define _PTHREAD_FUNCTIONS_H	1
Packit 6c4009
Packit 6c4009
#include <pthread.h>
Packit 6c4009
#include <setjmp.h>
Packit 6c4009
#include <internaltypes.h>
Packit 6c4009
#include <sysdep.h>
Packit 6c4009
Packit 6c4009
struct xid_command;
Packit 6c4009
Packit 6c4009
/* Data type shared with libc.  The libc uses it to pass on calls to
Packit 6c4009
   the thread functions.  */
Packit 6c4009
struct pthread_functions
Packit 6c4009
{
Packit 6c4009
  int (*ptr_pthread_attr_destroy) (pthread_attr_t *);
Packit 6c4009
  int (*ptr___pthread_attr_init_2_0) (pthread_attr_t *);
Packit 6c4009
  int (*ptr___pthread_attr_init_2_1) (pthread_attr_t *);
Packit 6c4009
  int (*ptr_pthread_attr_getdetachstate) (const pthread_attr_t *, int *);
Packit 6c4009
  int (*ptr_pthread_attr_setdetachstate) (pthread_attr_t *, int);
Packit 6c4009
  int (*ptr_pthread_attr_getinheritsched) (const pthread_attr_t *, int *);
Packit 6c4009
  int (*ptr_pthread_attr_setinheritsched) (pthread_attr_t *, int);
Packit 6c4009
  int (*ptr_pthread_attr_getschedparam) (const pthread_attr_t *,
Packit 6c4009
					 struct sched_param *);
Packit 6c4009
  int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *,
Packit 6c4009
					 const struct sched_param *);
Packit 6c4009
  int (*ptr_pthread_attr_getschedpolicy) (const pthread_attr_t *, int *);
Packit 6c4009
  int (*ptr_pthread_attr_setschedpolicy) (pthread_attr_t *, int);
Packit 6c4009
  int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *);
Packit 6c4009
  int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int);
Packit 6c4009
  int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
Packit 6c4009
  int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
Packit 6c4009
  int (*ptr___pthread_cond_broadcast) (pthread_cond_t *);
Packit 6c4009
  int (*ptr___pthread_cond_destroy) (pthread_cond_t *);
Packit 6c4009
  int (*ptr___pthread_cond_init) (pthread_cond_t *,
Packit 6c4009
				  const pthread_condattr_t *);
Packit 6c4009
  int (*ptr___pthread_cond_signal) (pthread_cond_t *);
Packit 6c4009
  int (*ptr___pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *);
Packit 6c4009
  int (*ptr___pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *,
Packit 6c4009
				       const struct timespec *);
Packit 6c4009
  int (*ptr___pthread_cond_broadcast_2_0) (pthread_cond_2_0_t *);
Packit 6c4009
  int (*ptr___pthread_cond_destroy_2_0) (pthread_cond_2_0_t *);
Packit 6c4009
  int (*ptr___pthread_cond_init_2_0) (pthread_cond_2_0_t *,
Packit 6c4009
				      const pthread_condattr_t *);
Packit 6c4009
  int (*ptr___pthread_cond_signal_2_0) (pthread_cond_2_0_t *);
Packit 6c4009
  int (*ptr___pthread_cond_wait_2_0) (pthread_cond_2_0_t *, pthread_mutex_t *);
Packit 6c4009
  int (*ptr___pthread_cond_timedwait_2_0) (pthread_cond_2_0_t *,
Packit 6c4009
					   pthread_mutex_t *,
Packit 6c4009
					   const struct timespec *);
Packit 6c4009
  int (*ptr_pthread_equal) (pthread_t, pthread_t);
Packit 6c4009
  void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__));
Packit 6c4009
  int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *);
Packit 6c4009
  int (*ptr_pthread_setschedparam) (pthread_t, int,
Packit 6c4009
				    const struct sched_param *);
Packit 6c4009
  int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *);
Packit 6c4009
  int (*ptr_pthread_mutex_init) (pthread_mutex_t *,
Packit 6c4009
				 const pthread_mutexattr_t *);
Packit 6c4009
  int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
Packit 6c4009
  int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
Packit 6c4009
  int (*ptr___pthread_setcancelstate) (int, int *);
Packit 6c4009
  int (*ptr_pthread_setcanceltype) (int, int *);
Packit 6c4009
  void (*ptr___pthread_cleanup_upto) (__jmp_buf, char *);
Packit 6c4009
  int (*ptr___pthread_once) (pthread_once_t *, void (*) (void));
Packit 6c4009
  int (*ptr___pthread_rwlock_rdlock) (pthread_rwlock_t *);
Packit 6c4009
  int (*ptr___pthread_rwlock_wrlock) (pthread_rwlock_t *);
Packit 6c4009
  int (*ptr___pthread_rwlock_unlock) (pthread_rwlock_t *);
Packit 6c4009
  int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *));
Packit 6c4009
  void *(*ptr___pthread_getspecific) (pthread_key_t);
Packit 6c4009
  int (*ptr___pthread_setspecific) (pthread_key_t, const void *);
Packit 6c4009
  void (*ptr__pthread_cleanup_push_defer) (struct _pthread_cleanup_buffer *,
Packit 6c4009
					   void (*) (void *), void *);
Packit 6c4009
  void (*ptr__pthread_cleanup_pop_restore) (struct _pthread_cleanup_buffer *,
Packit 6c4009
					    int);
Packit 6c4009
#define HAVE_PTR_NTHREADS
Packit 6c4009
  unsigned int *ptr_nthreads;
Packit 6c4009
  void (*ptr___pthread_unwind) (__pthread_unwind_buf_t *)
Packit 6c4009
       __attribute ((noreturn)) __cleanup_fct_attribute;
Packit 6c4009
  void (*ptr__nptl_deallocate_tsd) (void);
Packit 6c4009
  int (*ptr__nptl_setxid) (struct xid_command *);
Packit 6c4009
  void (*ptr_set_robust) (struct pthread *);
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/* Variable in libc.so.  */
Packit 6c4009
extern struct pthread_functions __libc_pthread_functions attribute_hidden;
Packit 6c4009
extern int __libc_pthread_functions_init attribute_hidden;
Packit 6c4009
Packit 6c4009
#ifdef PTR_DEMANGLE
Packit 6c4009
# define PTHFCT_CALL(fct, params) \
Packit 6c4009
  ({ __typeof (__libc_pthread_functions.fct) __p;			      \
Packit 6c4009
     __p = __libc_pthread_functions.fct;				      \
Packit 6c4009
     PTR_DEMANGLE (__p);						      \
Packit 6c4009
     __p params; })
Packit 6c4009
#else
Packit 6c4009
# define PTHFCT_CALL(fct, params) \
Packit 6c4009
  __libc_pthread_functions.fct params
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#endif	/* pthread-functions.h */