diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-09-12 10:19:54 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-09-12 18:40:35 -0400 |
commit | 5f12ffe1239a5e4f8d4e98e2dff4e191a71f4693 (patch) | |
tree | 39d2397a4c158aa45e26538b0798fe2e23e0d431 /src/internal | |
parent | 09e87db555045bf3bcef69c692df24d13b2856fe (diff) | |
download | musl-5f12ffe1239a5e4f8d4e98e2dff4e191a71f4693.tar.gz musl-5f12ffe1239a5e4f8d4e98e2dff4e191a71f4693.tar.xz musl-5f12ffe1239a5e4f8d4e98e2dff4e191a71f4693.zip |
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/internal')
-rw-r--r-- | src/internal/libc.h | 6 | ||||
-rw-r--r-- | src/internal/lock.h | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/internal/libc.h b/src/internal/libc.h index 0a279184..10bd66bd 100644 --- a/src/internal/libc.h +++ b/src/internal/libc.h @@ -51,12 +51,6 @@ extern char *__progname, *__progname_full; extern hidden const char __libc_version[]; -/* Designed to avoid any overhead in non-threaded processes */ -hidden void __lock(volatile int *); -hidden void __unlock(volatile int *); -#define LOCK(x) __lock(x) -#define UNLOCK(x) __unlock(x) - hidden void __synccall(void (*)(void *), void *); hidden int __setxid(int, int, int, int); diff --git a/src/internal/lock.h b/src/internal/lock.h new file mode 100644 index 00000000..c77db6f7 --- /dev/null +++ b/src/internal/lock.h @@ -0,0 +1,9 @@ +#ifndef LOCK_H +#define LOCK_H + +hidden void __lock(volatile int *); +hidden void __unlock(volatile int *); +#define LOCK(x) __lock(x) +#define UNLOCK(x) __unlock(x) + +#endif |