]>
Commit | Line | Data |
---|---|---|
33574c17 | 1 | /* Declarations of internal pthread functions used by libc. Hurd version. |
d614a753 | 2 | Copyright (C) 2016-2020 Free Software Foundation, Inc. |
33574c17 ST |
3 | This file is part of the GNU C Library. |
4 | ||
5 | The GNU C Library is free software; you can redistribute it and/or | |
6 | modify it under the terms of the GNU Lesser General Public | |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the License, or (at your option) any later version. | |
9 | ||
10 | The GNU C Library is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | Lesser General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU Lesser General Public | |
16 | License along with the GNU C Library; if not, see | |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
33574c17 ST |
18 | |
19 | #ifndef _PTHREADP_H | |
20 | #define _PTHREADP_H 1 | |
21 | ||
22 | #include <pthread.h> | |
23 | ||
24 | /* These represent the interface used by glibc itself. */ | |
25 | ||
26 | extern pthread_t __pthread_self (void); | |
27 | extern int __pthread_kill (pthread_t threadid, int signo); | |
28 | extern struct __pthread **__pthread_threads; | |
29 | ||
f6fb29d2 | 30 | extern int _pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr); |
33574c17 ST |
31 | extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); |
32 | extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); | |
33 | ||
f6fb29d2 ST |
34 | extern int __pthread_cond_broadcast (pthread_cond_t *cond); |
35 | ||
33574c17 ST |
36 | typedef struct __cthread *__cthread_t; |
37 | typedef int __cthread_key_t; | |
38 | typedef void * (*__cthread_fn_t)(void *__arg); | |
39 | ||
40 | __cthread_t __cthread_fork (__cthread_fn_t, void *); | |
f6fb29d2 ST |
41 | int __pthread_create (pthread_t *newthread, |
42 | const pthread_attr_t *attr, | |
43 | void *(*start_routine) (void *), void *arg); | |
44 | ||
33574c17 | 45 | void __cthread_detach (__cthread_t); |
f6fb29d2 ST |
46 | int __pthread_detach (pthread_t __threadp); |
47 | void __pthread_exit (void *value) __attribute__ ((__noreturn__)); | |
33574c17 ST |
48 | int __cthread_keycreate (__cthread_key_t *); |
49 | int __cthread_getspecific (__cthread_key_t, void **); | |
50 | int __cthread_setspecific (__cthread_key_t, void *); | |
f6fb29d2 ST |
51 | int __pthread_key_create (pthread_key_t *key, void (*destr) (void *)); |
52 | void *__pthread_getspecific (pthread_key_t key); | |
53 | int __pthread_setspecific (pthread_key_t key, const void *value); | |
54 | ||
55 | int __pthread_setcancelstate (int state, int *oldstate); | |
33574c17 ST |
56 | |
57 | int __pthread_getattr_np (pthread_t, pthread_attr_t *); | |
f6fb29d2 ST |
58 | int __pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, |
59 | void **__restrict __stackaddr); | |
60 | int __pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr); | |
61 | int __pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, | |
62 | size_t *__restrict __stacksize); | |
63 | int __pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize); | |
64 | int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, | |
65 | size_t __stacksize); | |
33574c17 | 66 | int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *); |
f96a85e0 | 67 | struct __pthread_cancelation_handler **___pthread_get_cleanup_stack (void) attribute_hidden; |
f6fb29d2 ST |
68 | |
69 | #if IS_IN (libpthread) | |
70 | hidden_proto (__pthread_key_create) | |
8ac0f9e6 ST |
71 | hidden_proto (__pthread_getspecific) |
72 | hidden_proto (__pthread_setspecific) | |
f6fb29d2 ST |
73 | hidden_proto (_pthread_mutex_init) |
74 | #endif | |
33574c17 ST |
75 | |
76 | #endif /* pthreadP.h */ |