Skip to content

Commit

Permalink
tests: systemclock: Stop all stress threads before joining them
Browse files Browse the repository at this point in the history
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/734>
  • Loading branch information
heftig committed Jan 14, 2021
1 parent b95941d commit 3a38055
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/check/gst/gstsystemclock.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3a38055

Please sign in to comment.