diff --git a/iiod-responder.c b/iiod-responder.c index 5cd00d24d..44aba2611 100644 --- a/iiod-responder.c +++ b/iiod-responder.c @@ -269,9 +269,12 @@ static int iiod_responder_reader_worker(struct iiod_responder *priv) } iio_mutex_lock(priv->lock); - if (ret <= 0) + if (ret <= 0) { + printf("Reader thread EOF\n"); break; + } + printf("Reader thread op:%u\n", cmd.op); if (cmd.op != IIOD_OP_RESPONSE) { iio_mutex_unlock(priv->lock); @@ -293,6 +296,7 @@ static int iiod_responder_reader_worker(struct iiod_responder *priv) if (!io) { /* We received a response, but have no client waiting * for it, so drop it. */ + printf("Reader thread no io\n"); iio_mutex_unlock(priv->lock); iiod_discard_data(priv, cmd.code); iio_mutex_lock(priv->lock); @@ -316,6 +320,7 @@ static int iiod_responder_reader_worker(struct iiod_responder *priv) iio_mutex_lock(priv->lock); if (ret <= 0) { + printf("Reader thread no data\n"); iiod_responder_signal_io(io, (int32_t) ret); iiod_io_unref_unlocked(io); break; @@ -325,6 +330,7 @@ static int iiod_responder_reader_worker(struct iiod_responder *priv) } /* Wake up the reader */ + printf("Reader thread signal io %u\n", cmd.code); iiod_responder_signal_io(io, cmd.code); iiod_io_unref_unlocked(io); } @@ -332,6 +338,7 @@ static int iiod_responder_reader_worker(struct iiod_responder *priv) priv->thrd_err_code = priv->thrd_stop ? -EINTR : (int) ret; priv->thrd_stop = true; + printf("Reader thread stopped\n"); iiod_responder_cancel_responses(priv); iio_task_stop(priv->write_task); iio_task_flush(priv->write_task); diff --git a/iiod/responder.c b/iiod/responder.c index 7e3b93b11..26a646633 100644 --- a/iiod/responder.c +++ b/iiod/responder.c @@ -320,6 +320,7 @@ static int buffer_dequeue_block(void *priv, void *d) unsigned int nb_data = 0; intptr_t ret; + printf("Dequeue block\n"); ret = iio_block_dequeue(entry->block, false); if (ret < 0) goto out_send_response; diff --git a/lock.c b/lock.c index 1a1496883..85331c99d 100644 --- a/lock.c +++ b/lock.c @@ -171,6 +171,7 @@ int iio_thrd_join_and_destroy(struct iio_thrd *thrd) if (ret < 0) return ret; + printf("Joined thread %s(%lu)\n", thrd->name, thrd->thid); free(thrd); return (int)(intptr_t) retval;