From: Bert Vermeulen Date: Mon, 29 Oct 2012 21:10:05 +0000 (+0100) Subject: don't use deprecated g_thread_init/_create X-Git-Tag: dsupstream~616 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4ca378df8874b8e0bfd323c725c019c3968c0e1e;p=libsigrok.git don't use deprecated g_thread_init/_create --- diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index e435482e..8300e6f4 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -474,14 +474,12 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, 40, receive_data, devc); /* Run the demo thread. */ - g_thread_init(NULL); - /* This must to be done between g_thread_init() & g_thread_create(). */ devc->timer = g_timer_new(); thread_running = 1; - my_thread = - g_thread_create((GThreadFunc)thread_func, devc, TRUE, NULL); + my_thread = g_thread_try_new("sigrok demo generator", + (GThreadFunc)thread_func, devc, NULL); if (!my_thread) { - sr_err("demo: %s: g_thread_create failed", __func__); + sr_err("demo: %s: g_thread_try_new failed", __func__); return SR_ERR; /* TODO */ }