Back to index

glibc  2.9
pthread-functions.h
Go to the documentation of this file.
00001 /* Copyright (C) 2003 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003    Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _PTHREAD_FUNCTIONS_H
00021 #define _PTHREAD_FUNCTIONS_H       1
00022 
00023 #include <pthread.h>
00024 #include <setjmp.h>
00025 #include <linuxthreads/descr.h>
00026 
00027 struct fork_block;
00028 
00029 /* Data type shared with libc.  The libc uses it to pass on calls to
00030    the thread functions.  Wine pokes directly into this structure,
00031    so if possible avoid breaking it and append new hooks to the end.  */
00032 struct pthread_functions
00033 {
00034   pid_t (*ptr_pthread_fork) (struct fork_block *);
00035   int (*ptr_pthread_attr_destroy) (pthread_attr_t *);
00036   int (*ptr___pthread_attr_init_2_0) (pthread_attr_t *);
00037   int (*ptr___pthread_attr_init_2_1) (pthread_attr_t *);
00038   int (*ptr_pthread_attr_getdetachstate) (const pthread_attr_t *, int *);
00039   int (*ptr_pthread_attr_setdetachstate) (pthread_attr_t *, int);
00040   int (*ptr_pthread_attr_getinheritsched) (const pthread_attr_t *, int *);
00041   int (*ptr_pthread_attr_setinheritsched) (pthread_attr_t *, int);
00042   int (*ptr_pthread_attr_getschedparam) (const pthread_attr_t *,
00043                                     struct sched_param *);
00044   int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *,
00045                                     const struct sched_param *);
00046   int (*ptr_pthread_attr_getschedpolicy) (const pthread_attr_t *, int *);
00047   int (*ptr_pthread_attr_setschedpolicy) (pthread_attr_t *, int);
00048   int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *);
00049   int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int);
00050   int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
00051   int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
00052   int (*ptr___pthread_cond_broadcast) (pthread_cond_t *);
00053   int (*ptr___pthread_cond_destroy) (pthread_cond_t *);
00054   int (*ptr___pthread_cond_init) (pthread_cond_t *,
00055                               const pthread_condattr_t *);
00056   int (*ptr___pthread_cond_signal) (pthread_cond_t *);
00057   int (*ptr___pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *);
00058   int (*ptr_pthread_equal) (pthread_t, pthread_t);
00059   void (*ptr___pthread_exit) (void *);
00060   int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *);
00061   int (*ptr_pthread_setschedparam) (pthread_t, int,
00062                                 const struct sched_param *);
00063   int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *);
00064   int (*ptr_pthread_mutex_init) (pthread_mutex_t *,
00065                              const pthread_mutexattr_t *);
00066   int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
00067   int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *);
00068   int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
00069   pthread_t (*ptr_pthread_self) (void);
00070   int (*ptr_pthread_setcancelstate) (int, int *);
00071   int (*ptr_pthread_setcanceltype) (int, int *);
00072   void (*ptr_pthread_do_exit) (void *retval, char *currentframe);
00073   void (*ptr_pthread_cleanup_upto) (__jmp_buf target,
00074                                 char *targetframe);
00075   pthread_descr (*ptr_pthread_thread_self) (void);
00076   int (*ptr_pthread_internal_tsd_set) (int key, const void *pointer);
00077   void * (*ptr_pthread_internal_tsd_get) (int key);
00078   void ** __attribute__ ((__const__))
00079     (*ptr_pthread_internal_tsd_address) (int key);
00080   int (*ptr_pthread_sigaction) (int sig, const struct sigaction * act,
00081                             struct sigaction *oact);
00082   int (*ptr_pthread_sigwait) (const sigset_t *set, int *sig);
00083   int (*ptr_pthread_raise) (int sig);
00084   int (*ptr___pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *,
00085                                    const struct timespec *);
00086   void (*ptr__pthread_cleanup_push) (struct _pthread_cleanup_buffer * buffer,
00087                                  void (*routine)(void *), void * arg);
00088 
00089   void (*ptr__pthread_cleanup_pop) (struct _pthread_cleanup_buffer * buffer,
00090                                 int execute);
00091 };
00092 
00093 /* Variable in libc.so.  */
00094 extern struct pthread_functions __libc_pthread_functions attribute_hidden;
00095 
00096 #endif /* pthread-functions.h */