mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUILD: thread: use initcall instead of a constructor
The constructor present there could be replaced with an initcall. This one is set at level STG_PREPARE because it also zeroes the lock_stats, and it's a bit odd that it could possibly have been scheduled to run after other constructors that might already preset some of these locks by accident.
This commit is contained in:
parent
79367f9a8d
commit
8ead1d084a
@ -951,7 +951,6 @@ static inline void preload_libgcc_s(void)
|
|||||||
pthread_join(dummy_thread, NULL);
|
pthread_join(dummy_thread, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((constructor))
|
|
||||||
static void __thread_init(void)
|
static void __thread_init(void)
|
||||||
{
|
{
|
||||||
char *ptr = NULL;
|
char *ptr = NULL;
|
||||||
@ -975,6 +974,7 @@ static void __thread_init(void)
|
|||||||
memset(lock_stats, 0, sizeof(lock_stats));
|
memset(lock_stats, 0, sizeof(lock_stats));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
INITCALL0(STG_PREPARE, __thread_init);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user