mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
BUG/MINOR: thread: add a check for pthread_create
preload_libgcc_s() use pthread_create to create a thread and then call pthread_join to use it, but it doesn't check if the option is successful. So add a check to aviod potential crash.
This commit is contained in:
parent
15c3d20e31
commit
ef667b1ad8
@ -1066,8 +1066,8 @@ static void *dummy_thread_function(void *data)
|
||||
static inline void preload_libgcc_s(void)
|
||||
{
|
||||
pthread_t dummy_thread;
|
||||
pthread_create(&dummy_thread, NULL, dummy_thread_function, NULL);
|
||||
pthread_join(dummy_thread, NULL);
|
||||
if (pthread_create(&dummy_thread, NULL, dummy_thread_function, NULL) == 0)
|
||||
pthread_join(dummy_thread, NULL);
|
||||
}
|
||||
|
||||
static void __thread_init(void)
|
||||
|
Loading…
Reference in New Issue
Block a user