]> sourceware.org Git - glibc.git/blame - sysdeps/htl/pthreadP.h
htl: Move thread table to ld.so
[glibc.git] / sysdeps / htl / pthreadP.h
CommitLineData
33574c17 1/* Declarations of internal pthread functions used by libc. Hurd version.
2b778ceb 2 Copyright (C) 2016-2021 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
a25077a4
ST
22#define __PTHREAD_HTL
23
33574c17 24#include <pthread.h>
af27fabe 25#include <link.h>
33574c17 26
0c036123
ST
27/* Attribute to indicate thread creation was issued from C11 thrd_create. */
28#define ATTR_C11_THREAD ((void*)(uintptr_t)-1)
29
af27fabe
ST
30extern void __pthread_init_static_tls (struct link_map *) attribute_hidden;
31
33574c17
ST
32/* These represent the interface used by glibc itself. */
33
e775f443
ST
34extern int __pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__attr);
35extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
33574c17 36extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
95669bbf 37extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex);
a8f0fc4e
ST
38extern int __pthread_mutex_timedlock (pthread_mutex_t *__mutex,
39 const struct timespec *__abstime);
33574c17 40extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
95669bbf
ST
41extern int __pthread_mutexattr_init (pthread_mutexattr_t *attr);
42extern int __pthread_mutexattr_settype (pthread_mutexattr_t *attr, int kind);
33574c17 43
95669bbf
ST
44extern int __pthread_cond_init (pthread_cond_t *cond,
45 const pthread_condattr_t *cond_attr);
46extern int __pthread_cond_signal (pthread_cond_t *cond);
f6fb29d2 47extern int __pthread_cond_broadcast (pthread_cond_t *cond);
95669bbf
ST
48extern int __pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex);
49extern int __pthread_cond_timedwait (pthread_cond_t *cond,
50 pthread_mutex_t *mutex,
51 const struct timespec *abstime);
28cada04
ST
52extern int __pthread_cond_clockwait (pthread_cond_t *cond,
53 pthread_mutex_t *mutex,
54 clockid_t clockid,
55 const struct timespec *abstime)
56 __nonnull ((1, 2, 4));
95669bbf 57extern int __pthread_cond_destroy (pthread_cond_t *cond);
f6fb29d2 58
33574c17
ST
59typedef struct __cthread *__cthread_t;
60typedef int __cthread_key_t;
61typedef void * (*__cthread_fn_t)(void *__arg);
62
63__cthread_t __cthread_fork (__cthread_fn_t, void *);
f6fb29d2
ST
64int __pthread_create (pthread_t *newthread,
65 const pthread_attr_t *attr,
66 void *(*start_routine) (void *), void *arg);
67
33574c17 68void __cthread_detach (__cthread_t);
f6fb29d2
ST
69int __pthread_detach (pthread_t __threadp);
70void __pthread_exit (void *value) __attribute__ ((__noreturn__));
e404be33 71int __pthread_join (pthread_t, void **);
33574c17
ST
72int __cthread_keycreate (__cthread_key_t *);
73int __cthread_getspecific (__cthread_key_t, void **);
74int __cthread_setspecific (__cthread_key_t, void *);
f6fb29d2
ST
75int __pthread_key_create (pthread_key_t *key, void (*destr) (void *));
76void *__pthread_getspecific (pthread_key_t key);
77int __pthread_setspecific (pthread_key_t key, const void *value);
95669bbf
ST
78int __pthread_key_delete (pthread_key_t key);
79int __pthread_once (pthread_once_t *once_control, void (*init_routine) (void));
f6fb29d2
ST
80
81int __pthread_setcancelstate (int state, int *oldstate);
33574c17
ST
82
83int __pthread_getattr_np (pthread_t, pthread_attr_t *);
f6fb29d2
ST
84int __pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr,
85 void **__restrict __stackaddr);
86int __pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr);
87int __pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr,
88 size_t *__restrict __stacksize);
89int __pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize);
90int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
91 size_t __stacksize);
33574c17 92int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *);
59b7fe99 93void __pthread_testcancel (void);
f6fb29d2
ST
94
95#if IS_IN (libpthread)
7c331116
ST
96hidden_proto (__pthread_create)
97hidden_proto (__pthread_detach)
f6fb29d2 98hidden_proto (__pthread_key_create)
8ac0f9e6
ST
99hidden_proto (__pthread_getspecific)
100hidden_proto (__pthread_setspecific)
e775f443 101hidden_proto (__pthread_mutex_init)
b05de104 102hidden_proto (__pthread_mutex_destroy)
0b217e59
ST
103hidden_proto (__pthread_mutex_lock)
104hidden_proto (__pthread_mutex_trylock)
105hidden_proto (__pthread_mutex_unlock)
b05de104 106hidden_proto (__pthread_mutex_timedlock)
f1cd3407 107hidden_proto (__pthread_get_cleanup_stack)
f6fb29d2 108#endif
33574c17 109
196e62cb
ST
110#define ASSERT_TYPE_SIZE(type, size) \
111 _Static_assert (sizeof (type) == size, \
112 "sizeof (" #type ") != " #size)
113
33574c17 114#endif /* pthreadP.h */
This page took 0.12707 seconds and 5 git commands to generate.