pthread-functions.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* Copyright (C) 2003 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _PTHREAD_FUNCTIONS_H
  16. #define _PTHREAD_FUNCTIONS_H 1
  17. #include <pthread.h>
  18. #include <setjmp.h>
  19. #include <linuxthreads/descr.h>
  20. struct fork_block;
  21. /* Data type shared with libc. The libc uses it to pass on calls to
  22. the thread functions. Wine pokes directly into this structure,
  23. so if possible avoid breaking it and append new hooks to the end. */
  24. struct pthread_functions
  25. {
  26. pid_t (*ptr_pthread_fork) (struct fork_block *);
  27. int (*ptr_pthread_attr_destroy) (pthread_attr_t *);
  28. int (*ptr_pthread_attr_init) (pthread_attr_t *);
  29. int (*ptr_pthread_attr_getdetachstate) (const pthread_attr_t *, int *);
  30. int (*ptr_pthread_attr_setdetachstate) (pthread_attr_t *, int);
  31. int (*ptr_pthread_attr_getinheritsched) (const pthread_attr_t *, int *);
  32. int (*ptr_pthread_attr_setinheritsched) (pthread_attr_t *, int);
  33. int (*ptr_pthread_attr_getschedparam) (const pthread_attr_t *,
  34. struct sched_param *);
  35. int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *,
  36. const struct sched_param *);
  37. int (*ptr_pthread_attr_getschedpolicy) (const pthread_attr_t *, int *);
  38. int (*ptr_pthread_attr_setschedpolicy) (pthread_attr_t *, int);
  39. int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *);
  40. int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int);
  41. int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
  42. int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
  43. int (*ptr_pthread_cond_broadcast) (pthread_cond_t *);
  44. int (*ptr_pthread_cond_destroy) (pthread_cond_t *);
  45. int (*ptr_pthread_cond_init) (pthread_cond_t *,
  46. const pthread_condattr_t *);
  47. int (*ptr_pthread_cond_signal) (pthread_cond_t *);
  48. int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *);
  49. int (*ptr_pthread_equal) (pthread_t, pthread_t);
  50. void (*ptr___pthread_exit) (void *);
  51. int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *);
  52. int (*ptr_pthread_setschedparam) (pthread_t, int,
  53. const struct sched_param *);
  54. int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *);
  55. int (*ptr_pthread_mutex_init) (pthread_mutex_t *,
  56. const pthread_mutexattr_t *);
  57. int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
  58. int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *);
  59. int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
  60. pthread_t (*ptr_pthread_self) (void);
  61. int (*ptr_pthread_setcancelstate) (int, int *);
  62. int (*ptr_pthread_setcanceltype) (int, int *);
  63. void (*ptr_pthread_do_exit) (void *retval, char *currentframe);
  64. void (*ptr_pthread_cleanup_upto) (__jmp_buf target,
  65. char *targetframe);
  66. pthread_descr (*ptr_pthread_thread_self) (void);
  67. #if !defined __UCLIBC_HAS_TLS__ && defined __UCLIBC_HAS_RPC__
  68. int (*ptr_pthread_internal_tsd_set) (int key, const void *pointer);
  69. void * (*ptr_pthread_internal_tsd_get) (int key);
  70. void ** __attribute__ ((__const__))
  71. (*ptr_pthread_internal_tsd_address) (int key);
  72. #endif
  73. int (*ptr_pthread_sigaction) (int sig, const struct sigaction * act,
  74. struct sigaction *oact);
  75. int (*ptr_pthread_sigwait) (const sigset_t *set, int *sig);
  76. int (*ptr_pthread_raise) (int sig);
  77. int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *,
  78. const struct timespec *);
  79. void (*ptr__pthread_cleanup_push) (struct _pthread_cleanup_buffer * buffer,
  80. void (*routine)(void *), void * arg);
  81. void (*ptr__pthread_cleanup_push_defer) (struct _pthread_cleanup_buffer * buffer,
  82. void (*routine)(void *), void * arg);
  83. void (*ptr__pthread_cleanup_pop) (struct _pthread_cleanup_buffer * buffer,
  84. int execute);
  85. void (*ptr__pthread_cleanup_pop_restore) (struct _pthread_cleanup_buffer * buffer,
  86. int execute);
  87. };
  88. /* Variable in libc.so. */
  89. extern struct pthread_functions __libc_pthread_functions attribute_hidden;
  90. extern int * __libc_pthread_init (const struct pthread_functions *functions);
  91. #endif /* pthread-functions.h */