if (G_LIKELY (clock->thread != NULL))
return TRUE; /* Thread already running. Nothing to do */
+#if !GLIB_CHECK_VERSION (2, 31, 0)
clock->thread = g_thread_create ((GThreadFunc) gst_system_clock_async_thread,
clock, TRUE, &error);
+#else
+ clock->thread = g_thread_try_new ("GstSystemClock",
+ (GThreadFunc) gst_system_clock_async_thread, clock, &error);
+#endif
+
if (G_UNLIKELY (error))
goto no_thread;
MAIN_START_THREAD_FUNCTIONS(count, function, data); \
MAIN_SYNCHRONIZE();
+#if GLIB_CHECK_VERSION (2, 31, 0)
+#define g_thread_create gst_g_thread_create
+static inline GThread *
+gst_g_thread_create (GThreadFunc func, gpointer data, gboolean joinable,
+ GError **error)
+{
+ g_assert (joinable);
+ return g_thread_try_new ("gst-check", func, data, error);
+}
+#endif
+
#define MAIN_INIT() \
G_STMT_START { \
_gst_check_threads_running = TRUE; \
gst_poll_add_fd (self->priv->fdset, &self->priv->sock);
gst_poll_fd_ctl_read (self->priv->fdset, &self->priv->sock, TRUE);
+#if !GLIB_CHECK_VERSION (2, 31, 0)
self->thread = g_thread_create (gst_net_client_clock_thread, self, TRUE,
&error);
- if (!self->thread)
+#else
+ self->thread = g_thread_try_new ("GstNetClientClock",
+ gst_net_client_clock_thread, self, &error);
+#endif
+
+ if (error != NULL)
goto no_thread;
return TRUE;
gst_poll_add_fd (self->priv->fdset, &self->priv->sock);
gst_poll_fd_ctl_read (self->priv->fdset, &self->priv->sock, TRUE);
+#if !GLIB_CHECK_VERSION (2, 31, 0)
self->thread = g_thread_create (gst_net_time_provider_thread, self, TRUE,
&error);
- if (!self->thread)
+#else
+ self->thread = g_thread_try_new ("GstNetTimeProvider",
+ gst_net_time_provider_thread, self, &error);
+#endif
+
+ if (error != NULL)
goto no_thread;
return TRUE;