mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Reference an external variable in threaded programs so that the
autoinitialiser gets linked in and therefore called before main().
This commit is contained in:
parent
7317e6b1fd
commit
96c76d66db
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35502
@ -60,6 +60,12 @@ exit(status)
|
||||
register struct atexit *p;
|
||||
register int n;
|
||||
|
||||
#ifdef _THREAD_SAFE
|
||||
extern int _thread_autoinit_dummy_decl;
|
||||
/* Ensure that the auto-initialization routine is linked in: */
|
||||
_thread_autoinit_dummy_decl = 1;
|
||||
#endif
|
||||
|
||||
for (p = __atexit; p; p = p->next)
|
||||
for (n = p->ind; --n >= 0;)
|
||||
(*p->fns[n])();
|
||||
|
Loading…
Reference in New Issue
Block a user