From 5889260d5a68ca13b2fb8ad22c7abb8063964e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 4 Dec 2011 13:35:38 +0000 Subject: Work around deprecated thread API in glib master Add private replacements for deprecated functions such as g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly to avoid the deprecation warnings. We can't change most of these in 0.10 because they're part of our API and ABI. --- gst/gsttask.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gst/gsttask.c') diff --git a/gst/gsttask.c b/gst/gsttask.c index e06e0d6917..c66c7b760c 100644 --- a/gst/gsttask.c +++ b/gst/gsttask.c @@ -72,6 +72,7 @@ #include "gstinfo.h" #include "gsttask.h" +#include "glib-compat-private.h" #include @@ -276,8 +277,13 @@ gst_task_func (GstTask * task) goto no_lock; task->abidata.ABI.thread = tself; /* only update the priority when it was changed */ - if (priv->prio_set) + if (priv->prio_set) { +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_set_priority (tself, priv->priority); +#else + GST_INFO_OBJECT (task, "Thread priorities no longer have any effect"); +#endif + } GST_OBJECT_UNLOCK (task); /* fire the enter_thread callback when we need to */ @@ -333,7 +339,9 @@ exit: } else { /* restore normal priority when releasing back into the pool, we will not * touch the priority when a custom callback has been installed. */ +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_set_priority (tself, G_THREAD_PRIORITY_NORMAL); +#endif } /* now we allow messing with the lock again by setting the running flag to * FALSE. Together with the SIGNAL this is the sign for the _join() to @@ -475,7 +483,11 @@ gst_task_set_priority (GstTask * task, GThreadPriority priority) if (thread != NULL) { /* if this task already has a thread, we can configure the priority right * away, else we do that when we assign a thread to the task. */ +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_set_priority (thread, priority); +#else + GST_INFO_OBJECT (task, "Thread priorities no longer have any effect"); +#endif } GST_OBJECT_UNLOCK (task); } -- cgit v1.2.1