]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/htl/pthreadP.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / htl / pthreadP.h
CommitLineData
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
26extern pthread_t __pthread_self (void);
27extern int __pthread_kill (pthread_t threadid, int signo);
28extern struct __pthread **__pthread_threads;
29
f6fb29d2 30extern int _pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr);
33574c17
ST
31extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
32extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
33
f6fb29d2
ST
34extern int __pthread_cond_broadcast (pthread_cond_t *cond);
35
33574c17
ST
36typedef struct __cthread *__cthread_t;
37typedef int __cthread_key_t;
38typedef void * (*__cthread_fn_t)(void *__arg);
39
40__cthread_t __cthread_fork (__cthread_fn_t, void *);
f6fb29d2
ST
41int __pthread_create (pthread_t *newthread,
42 const pthread_attr_t *attr,
43 void *(*start_routine) (void *), void *arg);
44
33574c17 45void __cthread_detach (__cthread_t);
f6fb29d2
ST
46int __pthread_detach (pthread_t __threadp);
47void __pthread_exit (void *value) __attribute__ ((__noreturn__));
33574c17
ST
48int __cthread_keycreate (__cthread_key_t *);
49int __cthread_getspecific (__cthread_key_t, void **);
50int __cthread_setspecific (__cthread_key_t, void *);
f6fb29d2
ST
51int __pthread_key_create (pthread_key_t *key, void (*destr) (void *));
52void *__pthread_getspecific (pthread_key_t key);
53int __pthread_setspecific (pthread_key_t key, const void *value);
54
55int __pthread_setcancelstate (int state, int *oldstate);
33574c17
ST
56
57int __pthread_getattr_np (pthread_t, pthread_attr_t *);
f6fb29d2
ST
58int __pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr,
59 void **__restrict __stackaddr);
60int __pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr);
61int __pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr,
62 size_t *__restrict __stacksize);
63int __pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize);
64int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
65 size_t __stacksize);
33574c17 66int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *);
f96a85e0 67struct __pthread_cancelation_handler **___pthread_get_cleanup_stack (void) attribute_hidden;
f6fb29d2
ST
68
69#if IS_IN (libpthread)
70hidden_proto (__pthread_key_create)
8ac0f9e6
ST
71hidden_proto (__pthread_getspecific)
72hidden_proto (__pthread_setspecific)
f6fb29d2
ST
73hidden_proto (_pthread_mutex_init)
74#endif
33574c17
ST
75
76#endif /* pthreadP.h */