Files
semi-libc/src/exit/quick_exit.c
T
Rich Felker 2e55da9118 remove useless synchronization in exit and quick_exit
calling exit more than once invokes undefined behavior. in some cases
it's desirable to detect undefined behavior and diagnose it via a
predictable crash, but the code here was silently covering up an
uncommon case (exit from more than one thread) and turning a much more
common case (recursive calls to exit) into a permanent hang.
2014-05-29 16:35:09 -04:00

12 lines
186 B
C

#include <stdlib.h>
#include "libc.h"
static void dummy() { }
weak_alias(dummy, __funcs_on_quick_exit);
_Noreturn void quick_exit(int code)
{
__funcs_on_quick_exit();
_Exit(code);
}