mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-22 04:01:57 +03:00
Fix BZ 14333
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <libc-lock.h>
|
||||
|
||||
enum
|
||||
{
|
||||
@ -57,11 +58,27 @@ struct exit_function_list
|
||||
size_t idx;
|
||||
struct exit_function fns[32];
|
||||
};
|
||||
|
||||
extern struct exit_function_list *__exit_funcs attribute_hidden;
|
||||
extern struct exit_function_list *__quick_exit_funcs attribute_hidden;
|
||||
extern uint64_t __new_exitfn_called attribute_hidden;
|
||||
|
||||
/* True once all registered atexit/at_quick_exit/onexit handlers have been
|
||||
called */
|
||||
extern bool __exit_funcs_done attribute_hidden;
|
||||
|
||||
/* This lock protects __exit_funcs, __quick_exit_funcs, __exit_funcs_done
|
||||
and __new_exitfn_called globals against simultaneous access from
|
||||
atexit/on_exit/at_quick_exit in multiple threads, and also from
|
||||
simultaneous access while another thread is in the middle of calling
|
||||
exit handlers. See BZ#14333. Note: for lists, the entire list, and
|
||||
each associated entry in the list, is protected for all access by this
|
||||
lock. */
|
||||
__libc_lock_define (extern, __exit_funcs_lock);
|
||||
|
||||
|
||||
extern struct exit_function *__new_exitfn (struct exit_function_list **listp);
|
||||
extern uint64_t __new_exitfn_called attribute_hidden;
|
||||
|
||||
|
||||
extern void __run_exit_handlers (int status,
|
||||
struct exit_function_list **listp,
|
||||
|
Reference in New Issue
Block a user