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:
Rich Felker committed 2018-09-12 18:40:35 -04:00
1 parent 09e87db555
commit 5f12ffe123
25 files changed
+32 -17

No files matched your search

-6
View File
@@ -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);
+9
View File
@@ -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