summaryrefslogtreecommitdiff
path: root/src/thread
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread')
-rw-r--r--src/thread/__timedwait.c3
-rw-r--r--src/thread/call_once.c3
-rw-r--r--src/thread/cnd_broadcast.c2
-rw-r--r--src/thread/cnd_signal.c2
-rw-r--r--src/thread/cnd_timedwait.c2
-rw-r--r--src/thread/mtx_timedlock.c2
-rw-r--r--src/thread/mtx_trylock.c2
-rw-r--r--src/thread/mtx_unlock.c2
-rw-r--r--src/thread/pthread_cond_broadcast.c2
-rw-r--r--src/thread/pthread_cond_signal.c2
-rw-r--r--src/thread/pthread_cond_timedwait.c5
-rw-r--r--src/thread/pthread_create.c4
-rw-r--r--src/thread/pthread_detach.c2
-rw-r--r--src/thread/pthread_join.c4
-rw-r--r--src/thread/pthread_mutex_lock.c2
-rw-r--r--src/thread/pthread_mutex_timedlock.c2
-rw-r--r--src/thread/sem_open.c2
-rw-r--r--src/thread/thrd_create.c2
-rw-r--r--src/thread/thrd_exit.c5
-rw-r--r--src/thread/thrd_join.c3
-rw-r--r--src/thread/tss_create.c3
-rw-r--r--src/thread/tss_delete.c3
22 files changed, 6 insertions, 53 deletions
diff --git a/src/thread/__timedwait.c b/src/thread/__timedwait.c
index d2079c88..229db313 100644
--- a/src/thread/__timedwait.c
+++ b/src/thread/__timedwait.c
@@ -5,9 +5,6 @@
#include "syscall.h"
#include "pthread_impl.h"
-int __pthread_setcancelstate(int, int *);
-int __clock_gettime(clockid_t, struct timespec *);
-
int __timedwait_cp(volatile int *addr, int val,
clockid_t clk, const struct timespec *at, int priv)
{
diff --git a/src/thread/call_once.c b/src/thread/call_once.c
index a7bc9353..5ed30183 100644
--- a/src/thread/call_once.c
+++ b/src/thread/call_once.c
@@ -1,6 +1,5 @@
#include <threads.h>
-
-int __pthread_once(once_flag *, void (*)(void));
+#include <pthread.h>
void call_once(once_flag *flag, void (*func)(void))
{
diff --git a/src/thread/cnd_broadcast.c b/src/thread/cnd_broadcast.c
index 0ad061a3..e76b5a81 100644
--- a/src/thread/cnd_broadcast.c
+++ b/src/thread/cnd_broadcast.c
@@ -1,8 +1,6 @@
#include <threads.h>
#include <pthread.h>
-int __private_cond_signal(pthread_cond_t *, int);
-
int cnd_broadcast(cnd_t *c)
{
/* This internal function never fails, and always returns zero,
diff --git a/src/thread/cnd_signal.c b/src/thread/cnd_signal.c
index 8165dae1..02cdc6c6 100644
--- a/src/thread/cnd_signal.c
+++ b/src/thread/cnd_signal.c
@@ -1,8 +1,6 @@
#include <threads.h>
#include <pthread.h>
-int __private_cond_signal(pthread_cond_t *, int);
-
int cnd_signal(cnd_t *c)
{
/* This internal function never fails, and always returns zero,
diff --git a/src/thread/cnd_timedwait.c b/src/thread/cnd_timedwait.c
index 7bfe1045..2802af52 100644
--- a/src/thread/cnd_timedwait.c
+++ b/src/thread/cnd_timedwait.c
@@ -2,8 +2,6 @@
#include <pthread.h>
#include <errno.h>
-int __pthread_cond_timedwait(pthread_cond_t *restrict, pthread_mutex_t *restrict, const struct timespec *restrict);
-
int cnd_timedwait(cnd_t *restrict c, mtx_t *restrict m, const struct timespec *restrict ts)
{
int ret = __pthread_cond_timedwait((pthread_cond_t *)c, (pthread_mutex_t *)m, ts);
diff --git a/src/thread/mtx_timedlock.c b/src/thread/mtx_timedlock.c
index d098053b..d22c8cf4 100644
--- a/src/thread/mtx_timedlock.c
+++ b/src/thread/mtx_timedlock.c
@@ -2,8 +2,6 @@
#include <pthread.h>
#include <errno.h>
-int __pthread_mutex_timedlock(pthread_mutex_t *restrict, const struct timespec *restrict);
-
int mtx_timedlock(mtx_t *restrict m, const struct timespec *restrict ts)
{
int ret = __pthread_mutex_timedlock((pthread_mutex_t *)m, ts);
diff --git a/src/thread/mtx_trylock.c b/src/thread/mtx_trylock.c
index 8d1fb07c..40a8b8c2 100644
--- a/src/thread/mtx_trylock.c
+++ b/src/thread/mtx_trylock.c
@@ -1,8 +1,6 @@
#include "pthread_impl.h"
#include <threads.h>
-int __pthread_mutex_trylock(pthread_mutex_t *);
-
int mtx_trylock(mtx_t *m)
{
if (m->_m_type == PTHREAD_MUTEX_NORMAL)
diff --git a/src/thread/mtx_unlock.c b/src/thread/mtx_unlock.c
index ac91f993..2e5c8cf6 100644
--- a/src/thread/mtx_unlock.c
+++ b/src/thread/mtx_unlock.c
@@ -1,8 +1,6 @@
#include <threads.h>
#include <pthread.h>
-int __pthread_mutex_unlock(pthread_mutex_t *);
-
int mtx_unlock(mtx_t *mtx)
{
/* The only cases where pthread_mutex_unlock can return an
diff --git a/src/thread/pthread_cond_broadcast.c b/src/thread/pthread_cond_broadcast.c
index 69f840fb..6bfab78f 100644
--- a/src/thread/pthread_cond_broadcast.c
+++ b/src/thread/pthread_cond_broadcast.c
@@ -1,7 +1,5 @@
#include "pthread_impl.h"
-int __private_cond_signal(pthread_cond_t *, int);
-
int pthread_cond_broadcast(pthread_cond_t *c)
{
if (!c->_c_shared) return __private_cond_signal(c, -1);
diff --git a/src/thread/pthread_cond_signal.c b/src/thread/pthread_cond_signal.c
index 119c00ab..575ad54b 100644
--- a/src/thread/pthread_cond_signal.c
+++ b/src/thread/pthread_cond_signal.c
@@ -1,7 +1,5 @@
#include "pthread_impl.h"
-int __private_cond_signal(pthread_cond_t *, int);
-
int pthread_cond_signal(pthread_cond_t *c)
{
if (!c->_c_shared) return __private_cond_signal(c, 1);
diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
index ed8569c2..d1501240 100644
--- a/src/thread/pthread_cond_timedwait.c
+++ b/src/thread/pthread_cond_timedwait.c
@@ -1,10 +1,5 @@
#include "pthread_impl.h"
-void __pthread_testcancel(void);
-int __pthread_mutex_lock(pthread_mutex_t *);
-int __pthread_mutex_unlock(pthread_mutex_t *);
-int __pthread_setcancelstate(int, int *);
-
/*
* struct waiter
*
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index dc869dc1..23dfe0ad 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -6,10 +6,6 @@
#include <string.h>
#include <stddef.h>
-void *__mmap(void *, size_t, int, int, int, off_t);
-int __munmap(void *, size_t);
-int __mprotect(void *, size_t, int);
-
static void dummy_0()
{
}
diff --git a/src/thread/pthread_detach.c b/src/thread/pthread_detach.c
index 9cee7a89..16b0552d 100644
--- a/src/thread/pthread_detach.c
+++ b/src/thread/pthread_detach.c
@@ -1,8 +1,6 @@
#include "pthread_impl.h"
#include <threads.h>
-int __pthread_join(pthread_t, void **);
-
static int __pthread_detach(pthread_t t)
{
/* If the cas fails, detach state is either already-detached
diff --git a/src/thread/pthread_join.c b/src/thread/pthread_join.c
index 551c3675..54d81039 100644
--- a/src/thread/pthread_join.c
+++ b/src/thread/pthread_join.c
@@ -1,10 +1,6 @@
#include "pthread_impl.h"
#include <sys/mman.h>
-int __munmap(void *, size_t);
-void __pthread_testcancel(void);
-int __pthread_setcancelstate(int, int *);
-
static int __pthread_timedjoin_np(pthread_t t, void **res, const struct timespec *at)
{
int state, cs, r = 0;
diff --git a/src/thread/pthread_mutex_lock.c b/src/thread/pthread_mutex_lock.c
index d0c93cab..638d4b86 100644
--- a/src/thread/pthread_mutex_lock.c
+++ b/src/thread/pthread_mutex_lock.c
@@ -1,7 +1,5 @@
#include "pthread_impl.h"
-int __pthread_mutex_timedlock(pthread_mutex_t *restrict, const struct timespec *restrict);
-
int __pthread_mutex_lock(pthread_mutex_t *m)
{
if ((m->_m_type&15) == PTHREAD_MUTEX_NORMAL
diff --git a/src/thread/pthread_mutex_timedlock.c b/src/thread/pthread_mutex_timedlock.c
index d2bd1960..9867f389 100644
--- a/src/thread/pthread_mutex_timedlock.c
+++ b/src/thread/pthread_mutex_timedlock.c
@@ -1,7 +1,5 @@
#include "pthread_impl.h"
-int __pthread_mutex_trylock(pthread_mutex_t *);
-
int __pthread_mutex_timedlock(pthread_mutex_t *restrict m, const struct timespec *restrict at)
{
if ((m->_m_type&15) == PTHREAD_MUTEX_NORMAL
diff --git a/src/thread/sem_open.c b/src/thread/sem_open.c
index dc0279e8..1bd8020a 100644
--- a/src/thread/sem_open.c
+++ b/src/thread/sem_open.c
@@ -13,8 +13,6 @@
#include <pthread.h>
#include "libc.h"
-char *__shm_mapname(const char *, char *);
-
static struct {
ino_t ino;
sem_t *sem;
diff --git a/src/thread/thrd_create.c b/src/thread/thrd_create.c
index e0336695..76a683db 100644
--- a/src/thread/thrd_create.c
+++ b/src/thread/thrd_create.c
@@ -1,8 +1,6 @@
#include "pthread_impl.h"
#include <threads.h>
-int __pthread_create(pthread_t *restrict, const pthread_attr_t *restrict, void *(*)(void *), void *restrict);
-
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
{
int ret = __pthread_create(thr, __ATTRP_C11_THREAD, (void *(*)(void *))func, arg);
diff --git a/src/thread/thrd_exit.c b/src/thread/thrd_exit.c
index b66bd996..9b291ae3 100644
--- a/src/thread/thrd_exit.c
+++ b/src/thread/thrd_exit.c
@@ -1,7 +1,6 @@
-#include "pthread_impl.h"
#include <threads.h>
-
-_Noreturn void __pthread_exit(void *);
+#include <pthread.h>
+#include <stdint.h>
_Noreturn void thrd_exit(int result)
{
diff --git a/src/thread/thrd_join.c b/src/thread/thrd_join.c
index ac667893..0d5fd302 100644
--- a/src/thread/thrd_join.c
+++ b/src/thread/thrd_join.c
@@ -1,7 +1,6 @@
#include <stdint.h>
#include <threads.h>
-
-int __pthread_join(thrd_t, void**);
+#include <pthread.h>
int thrd_join(thrd_t t, int *res)
{
diff --git a/src/thread/tss_create.c b/src/thread/tss_create.c
index 251d22b9..6d6ef96b 100644
--- a/src/thread/tss_create.c
+++ b/src/thread/tss_create.c
@@ -1,6 +1,5 @@
#include <threads.h>
-
-int __pthread_key_create(tss_t *, void (*)(void *));
+#include <pthread.h>
int tss_create(tss_t *tss, tss_dtor_t dtor)
{
diff --git a/src/thread/tss_delete.c b/src/thread/tss_delete.c
index 35db1032..6f51b07e 100644
--- a/src/thread/tss_delete.c
+++ b/src/thread/tss_delete.c
@@ -1,6 +1,5 @@
#include <threads.h>
-
-int __pthread_key_delete(tss_t k);
+#include <pthread.h>
void tss_delete(tss_t key)
{