mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
taskpool: Set error in case something goes wrong in the default handlers
This commit is contained in:
parent
0dd0a29c02
commit
e322250fb1
1 changed files with 5 additions and 1 deletions
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include "gstinfo.h"
|
#include "gstinfo.h"
|
||||||
#include "gsttaskpool.h"
|
#include "gsttaskpool.h"
|
||||||
|
#include "gsterror.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (taskpool_debug);
|
GST_DEBUG_CATEGORY_STATIC (taskpool_debug);
|
||||||
#define GST_CAT_DEFAULT (taskpool_debug)
|
#define GST_CAT_DEFAULT (taskpool_debug)
|
||||||
|
@ -73,7 +74,7 @@ static void
|
||||||
default_prepare (GstTaskPool * pool, GError ** error)
|
default_prepare (GstTaskPool * pool, GError ** error)
|
||||||
{
|
{
|
||||||
GST_OBJECT_LOCK (pool);
|
GST_OBJECT_LOCK (pool);
|
||||||
pool->pool = g_thread_pool_new ((GFunc) default_func, pool, -1, FALSE, NULL);
|
pool->pool = g_thread_pool_new ((GFunc) default_func, pool, -1, FALSE, error);
|
||||||
GST_OBJECT_UNLOCK (pool);
|
GST_OBJECT_UNLOCK (pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,6 +107,9 @@ default_push (GstTaskPool * pool, GstTaskPoolFunction func,
|
||||||
g_thread_pool_push (pool->pool, tdata, error);
|
g_thread_pool_push (pool->pool, tdata, error);
|
||||||
else {
|
else {
|
||||||
g_slice_free (TaskData, tdata);
|
g_slice_free (TaskData, tdata);
|
||||||
|
g_set_error_literal (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
|
||||||
|
"No thread pool");
|
||||||
|
|
||||||
}
|
}
|
||||||
GST_OBJECT_UNLOCK (pool);
|
GST_OBJECT_UNLOCK (pool);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue