summaryrefslogtreecommitdiff
path: root/src/thread
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-09-12 10:19:54 -0400
committerRich Felker <dalias@aerifal.cx>2018-09-12 18:40:35 -0400
commit5f12ffe1239a5e4f8d4e98e2dff4e191a71f4693 (patch)
tree39d2397a4c158aa45e26538b0798fe2e23e0d431 /src/thread
parent09e87db555045bf3bcef69c692df24d13b2856fe (diff)
downloadmusl-5f12ffe1239a5e4f8d4e98e2dff4e191a71f4693.tar.gz
split internal lock API out of libc.h, creating lock.h
this further reduces the number of source files which need to include libc.h and thereby be potentially exposed to libc global state and internals. this will also facilitate further improvements like adding an inline fast-path, if we want to do so later.
Diffstat (limited to 'src/thread')
-rw-r--r--src/thread/pthread_atfork.c1
-rw-r--r--src/thread/pthread_create.c1
-rw-r--r--src/thread/pthread_getschedparam.c1
-rw-r--r--src/thread/pthread_kill.c1
-rw-r--r--src/thread/pthread_setschedparam.c1
-rw-r--r--src/thread/pthread_setschedprio.c1
-rw-r--r--src/thread/sem_open.c2
-rw-r--r--src/thread/synccall.c1
8 files changed, 8 insertions, 1 deletions
diff --git a/src/thread/pthread_atfork.c b/src/thread/pthread_atfork.c
index c6f77b3f..76497401 100644
--- a/src/thread/pthread_atfork.c
+++ b/src/thread/pthread_atfork.c
@@ -1,5 +1,6 @@
#include <pthread.h>
#include "libc.h"
+#include "lock.h"
static struct atfork_funcs {
void (*prepare)(void);
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index 23dfe0ad..3293dcd5 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -2,6 +2,7 @@
#include "pthread_impl.h"
#include "stdio_impl.h"
#include "libc.h"
+#include "lock.h"
#include <sys/mman.h>
#include <string.h>
#include <stddef.h>
diff --git a/src/thread/pthread_getschedparam.c b/src/thread/pthread_getschedparam.c
index 05be4242..1cba073d 100644
--- a/src/thread/pthread_getschedparam.c
+++ b/src/thread/pthread_getschedparam.c
@@ -1,4 +1,5 @@
#include "pthread_impl.h"
+#include "lock.h"
int pthread_getschedparam(pthread_t t, int *restrict policy, struct sched_param *restrict param)
{
diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c
index 6d70e626..3d9395cb 100644
--- a/src/thread/pthread_kill.c
+++ b/src/thread/pthread_kill.c
@@ -1,4 +1,5 @@
#include "pthread_impl.h"
+#include "lock.h"
int pthread_kill(pthread_t t, int sig)
{
diff --git a/src/thread/pthread_setschedparam.c b/src/thread/pthread_setschedparam.c
index ab45f2ff..038d13d8 100644
--- a/src/thread/pthread_setschedparam.c
+++ b/src/thread/pthread_setschedparam.c
@@ -1,4 +1,5 @@
#include "pthread_impl.h"
+#include "lock.h"
int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *param)
{
diff --git a/src/thread/pthread_setschedprio.c b/src/thread/pthread_setschedprio.c
index c353f6b5..5bf4a019 100644
--- a/src/thread/pthread_setschedprio.c
+++ b/src/thread/pthread_setschedprio.c
@@ -1,4 +1,5 @@
#include "pthread_impl.h"
+#include "lock.h"
int pthread_setschedprio(pthread_t t, int prio)
{
diff --git a/src/thread/sem_open.c b/src/thread/sem_open.c
index 1bd8020a..de8555c5 100644
--- a/src/thread/sem_open.c
+++ b/src/thread/sem_open.c
@@ -11,7 +11,7 @@
#include <sys/stat.h>
#include <stdlib.h>
#include <pthread.h>
-#include "libc.h"
+#include "lock.h"
static struct {
ino_t ino;
diff --git a/src/thread/synccall.c b/src/thread/synccall.c
index ba2f258e..cc66bd24 100644
--- a/src/thread/synccall.c
+++ b/src/thread/synccall.c
@@ -7,6 +7,7 @@
#include "futex.h"
#include "atomic.h"
#include "../dirent/__dirent.h"
+#include "lock.h"
static struct chain {
struct chain *next;