Skip to content

Commit

Permalink
test_4
Browse files Browse the repository at this point in the history
  • Loading branch information
nunojsa committed Feb 5, 2025
1 parent 64b359f commit 90e3e11
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion iiod-responder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -325,13 +330,15 @@ 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);
}

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);
Expand Down
1 change: 1 addition & 0 deletions iiod/responder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 90e3e11

Please sign in to comment.