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
133 | 133 |
#define g_cond_signal(cond) g_compat_cond_signal(cond)
|
134 | 134 |
#undef g_cond_wait
|
135 | 135 |
#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 |
}
|
136 | 147 |
#endif
|
137 | 148 |
|
138 | 149 |
#if !GLIB_CHECK_VERSION(2,31,18)
|
395 | 395 |
|
396 | 396 |
g_timer_start(app->timer);
|
397 | 397 |
|
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);
|
399 | 400 |
if (!app->decoder_thread)
|
400 | 401 |
return FALSE;
|
401 | 402 |
return TRUE;
|
|
570 | 571 |
static gboolean
|
571 | 572 |
start_renderer(App *app)
|
572 | 573 |
{
|
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);
|
574 | 576 |
if (!app->render_thread)
|
575 | 577 |
return FALSE;
|
576 | 578 |
return TRUE;
|