]> sigrok.org Git - libsigrokdecode.git/blobdiff - instance.c
instance.c: Add a debug message for thread creation.
[libsigrokdecode.git] / instance.c
index 6c54d8d16c83f62ce1db75b6b2653216ff394907..1753912147a5fc6d2942a1015b11cee3c1856e86 100644 (file)
@@ -1012,7 +1012,9 @@ SRD_PRIV int srd_inst_decode(struct srd_decoder_inst *di,
 
        if (abs_start_samplenum != di->abs_cur_samplenum ||
            abs_end_samplenum < abs_start_samplenum) {
-               srd_dbg("incorrect sample numbers");
+               srd_dbg("Incorrect sample numbers: start=%" PRIu64 ", cur=%"
+                       PRIu64 ", end=%" PRIu64 ".", abs_start_samplenum,
+                       di->abs_cur_samplenum, abs_end_samplenum);
                return SRD_ERR_ARG;
        }
 
@@ -1052,9 +1054,12 @@ SRD_PRIV int srd_inst_decode(struct srd_decoder_inst *di,
                Py_DecRef(py_res);
        } else {
                /* If this is the first call, start the worker thread. */
-               if (!di->thread_handle)
-                       di->thread_handle = g_thread_new("di_thread",
+               if (!di->thread_handle) {
+                       srd_dbg("No worker thread for this decoder stack "
+                               "exists yet, creating one: %s.", di->inst_id);
+                       di->thread_handle = g_thread_new(di->inst_id,
                                                         di_thread, di);
+               }
 
                /* Push the new sample chunk to the worker thread. */
                g_mutex_lock(&di->data_mutex);