projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove __lock dependency from exit
[musl]
/
src
/
exit
/
exit.c
diff --git
a/src/exit/exit.c
b/src/exit/exit.c
index
1ff19db
..
fc29148
100644
(file)
--- a/
src/exit/exit.c
+++ b/
src/exit/exit.c
@@
-2,6
+2,8
@@
#include <unistd.h>
#include <stdio.h>
#include "libc.h"
#include <unistd.h>
#include <stdio.h>
#include "libc.h"
+#include "atomic.h"
+#include "syscall.h"
static void dummy()
{
static void dummy()
{
@@
-16,7
+18,7
@@
void exit(int code)
static int lock;
/* If more than one thread calls exit, hang until _Exit ends it all */
static int lock;
/* If more than one thread calls exit, hang until _Exit ends it all */
-
LOCK(&lock
);
+
while (a_swap(&lock, 1)) __syscall(SYS_pause
);
/* Only do atexit & stdio flush if they were actually used */
__funcs_on_exit();
/* Only do atexit & stdio flush if they were actually used */
__funcs_on_exit();