diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2011-12-04 13:35:38 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2011-12-04 13:35:38 +0000 |
commit | 5889260d5a68ca13b2fb8ad22c7abb8063964e06 (patch) | |
tree | 163139b53cdc1ec5cb2c0baa4d0248fb8c73c827 /gst/gsttask.c | |
parent | a8b79513c14f71a5cd39e92dadfd3dbba2bb9993 (diff) | |
download | gstreamer-5889260d5a68ca13b2fb8ad22c7abb8063964e06.tar.gz |
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.
Diffstat (limited to 'gst/gsttask.c')
-rw-r--r-- | gst/gsttask.c | 14 |
1 files changed, 13 insertions, 1 deletions
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 <stdio.h> @@ -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); } |