Skip to content

Commit

Permalink
iiod: Cancel buffer before freeing it
Browse files Browse the repository at this point in the history
This should stop any pending block enqueue/dequeue operations, making it
possible to destroy the buffer without waiting for I/O to finish.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Jan 31, 2024
1 parent 5a9be31 commit 39d0fb7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions iiod/responder.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ static void free_buffer_entry(struct buffer_entry *entry)
{
struct block_entry *block_entry, *block_next;

iio_buffer_cancel(entry->buf);

if (!NO_THREADS) {
iio_task_stop(entry->dequeue_task);
iio_task_stop(entry->enqueue_task);
Expand Down

0 comments on commit 39d0fb7

Please sign in to comment.