12 /* __towrite.c and atexit.c override these */
13 weak_alias(dummy, __funcs_on_exit);
14 weak_alias(dummy, __fflush_on_exit);
20 /* If more than one thread calls exit, hang until _Exit ends it all */
21 while (a_swap(&lock, 1)) __syscall(SYS_pause);
23 /* Only do atexit & stdio flush if they were actually used */
27 /* Destructor s**t is kept separate from atexit to avoid bloat */
28 if (libc.fini) libc.fini();
29 if (libc.ldso_fini) libc.ldso_fini();