Skip to content

gstcheck: Exit unused threadpool threads immediately

Ensures that all unused threads are exited before the atexit() handlers run.

This prevents a race with any thread that used the OpenSSL library between it's thread cleanup routine and it's atexit() cleanup routine which can cause a SIGSEGV.

Noticed with the webrtcbin tests. Ran with the fix for 1750 iterations successfully, however it was fairly hard for me to hit it before.

A possible better way is to use g_thread_pool_stop_unused_threads() in libcheck just before it calls exit() (in the fork case) however it currently doesn't use glib so didn't want to add that dependency.

Merge request reports