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.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <pthread.h>
|
||||
#include "libc.h"
|
||||
#include "lock.h"
|
||||
|
||||
static struct atfork_funcs {
|
||||
void (*prepare)(void);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "pthread_impl.h"
|
||||
#include "lock.h"
|
||||
|
||||
int pthread_kill(pthread_t t, int sig)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "pthread_impl.h"
|
||||
#include "lock.h"
|
||||
|
||||
int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *param)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "pthread_impl.h"
|
||||
#include "lock.h"
|
||||
|
||||
int pthread_setschedprio(pthread_t t, int prio)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "futex.h"
|
||||
#include "atomic.h"
|
||||
#include "../dirent/__dirent.h"
|
||||
#include "lock.h"
|
||||
|
||||
static struct chain {
|
||||
struct chain *next;
|
||||
|
||||
Reference in New Issue
Block a user