From 3a380558bdc0597b2f5be65595cd2b706969562c Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Thu, 14 Jan 2021 15:50:05 +0100 Subject: [PATCH] tests: systemclock: Stop all stress threads before joining them This reduces the chance of the main thread getting starved while trying to shut down the test, potentially causing a timeout. Even on an idle 96-processor system this reduces the duration of the systemclock tests from ~8s to ~3s. Part-of: --- tests/check/gst/gstsystemclock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/check/gst/gstsystemclock.c b/tests/check/gst/gstsystemclock.c index c1ae6bd8a6..2307a63b40 100644 --- a/tests/check/gst/gstsystemclock.c +++ b/tests/check/gst/gstsystemclock.c @@ -328,6 +328,9 @@ GST_START_TEST (test_stress_cleanup_unschedule) for (i = 0; i < num; i++) { WaitUnscheduleData *d = &data[i]; d->running = FALSE; + } + for (i = 0; i < num; i++) { + WaitUnscheduleData *d = &data[i]; g_thread_join (d->thread_wait); g_thread_join (d->thread_unschedule); g_mutex_clear (&d->lock); @@ -370,6 +373,9 @@ GST_START_TEST (test_stress_reschedule) for (i = 0; i < num; i++) { WaitUnscheduleData *d = &data[i]; d->running = FALSE; + } + for (i = 0; i < num; i++) { + WaitUnscheduleData *d = &data[i]; g_thread_join (d->thread_wait); g_thread_join (d->thread_unschedule); g_mutex_clear (&d->lock);