After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768577 - element: clean up thread pool from gst_task_cleanup_all()
element: clean up thread pool from gst_task_cleanup_all()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 767856
 
 
Reported: 2016-07-08 14:43 UTC by Guillaume Desmottes
Modified: 2016-07-08 16:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
element: clean up thread pool from gst_task_cleanup_all() (2.03 KB, patch)
2016-07-08 14:44 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2016-07-08 14:43:52 UTC
See commit message for the rational.
Comment 1 Guillaume Desmottes 2016-07-08 14:44:15 UTC
Created attachment 331085 [details] [review]
element: clean up thread pool from gst_task_cleanup_all()

This ensures that all async operations (started from gst_element_call_async())
have been completed and so there is no extra thread running.

Fix races when checking for leaks on unit tests as some of those
operations were still running when the leaks tracer was checking for
leaked objects.
Comment 2 Guillaume Desmottes 2016-07-08 14:45:26 UTC
Review of attachment 331085 [details] [review]:

::: gst/gstelement.c
@@ +3430,3 @@
+  if (gst_element_pool) {
+    g_thread_pool_free (gst_element_pool, FALSE, TRUE);
+    gst_element_pool = NULL;

Should we create a new pool as gsttasks.c:init_klass_pool() does?
Comment 3 Tim-Philipp Müller 2016-07-08 16:49:30 UTC
Sorry, I completely missed your question in comment #2 before pushing this. As it turns out, the answer is yes :)
commit 40727d9c838f1018f61c070f846454f28cde01c2
Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date:   Fri Jul 8 16:36:01 2016 +0200

    element: clean up thread pool from gst_task_cleanup_all()
    
    This ensures that all async operations (started from gst_element_call_async())
    have been completed and so there is no extra thread running.
    
    Fix races when checking for leaks on unit tests as some of those
    operations were still running when the leaks tracer was checking for
    leaked objects.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768577


commit 7a0f4422fa1692dfdd8df9580676c8125be4280b
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Fri Jul 8 17:46:06 2016 +0100

    element: re-create threadpool after cleaning up tasks
    
    We don't free this from gst_deinit() but from gst_task_cleanup_all(),
    so more GStreamer API may be called. In particular makes unit tests
    work again with CK_FORK=no.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768577