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.
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)