Codebase list gstreamer-vaapi / dd2ca58
tests: simple-decoder: don't use deprecated g_thread_create(). Use g_thread_try_new() instead of the deprecated g_thread_create() function. Provide compatibility glue for any GLib version < 2.31.2. Gwenole Beauchesne 10 years ago
2 changed file(s) with 15 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
133133 #define g_cond_signal(cond) g_compat_cond_signal(cond)
134134 #undef g_cond_wait
135135 #define g_cond_wait(cond, mutex) g_compat_cond_wait(cond, mutex)
136
137 #undef g_thread_try_new
138 #define g_thread_try_new(name, func, data, error) \
139 g_compat_thread_try_new(name, func, data, error)
140
141 static inline GThread *
142 g_compat_thread_try_new(const gchar *name, GThreadFunc func, gpointer data,
143 GError **error)
144 {
145 return g_thread_create(func, data, TRUE, error);
146 }
136147 #endif
137148
138149 #if !GLIB_CHECK_VERSION(2,31,18)
395395
396396 g_timer_start(app->timer);
397397
398 app->decoder_thread = g_thread_create(decoder_thread, app, TRUE, NULL);
398 app->decoder_thread = g_thread_try_new("Decoder Thread", decoder_thread,
399 app, NULL);
399400 if (!app->decoder_thread)
400401 return FALSE;
401402 return TRUE;
570571 static gboolean
571572 start_renderer(App *app)
572573 {
573 app->render_thread = g_thread_create(renderer_thread, app, TRUE, NULL);
574 app->render_thread = g_thread_try_new("Renderer Thread", renderer_thread,
575 app, NULL);
574576 if (!app->render_thread)
575577 return FALSE;
576578 return TRUE;