]> sigrok.org Git - libsigrok.git/commitdiff
don't use deprecated g_thread_init/_create
authorBert Vermeulen <redacted>
Mon, 29 Oct 2012 21:10:05 +0000 (22:10 +0100)
committerBert Vermeulen <redacted>
Mon, 29 Oct 2012 21:10:05 +0000 (22:10 +0100)
hardware/demo/demo.c

index e435482e32ac1c91e67aba58c1cfd452255765c9..8300e6f4eac401212bb2852db911a24668199f0d 100644 (file)
@@ -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 */
        }