Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
catkira committed Nov 7, 2024
1 parent e5efbea commit 3d007fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
3 changes: 0 additions & 3 deletions iiod-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ static ssize_t iiod_client_read_attr_new(struct iiod_client *client,
char *dest, size_t len)
{
struct iiod_io *io = iiod_responder_get_default_io(client->responder);
// printf("* thread = %u, iiod_responder_get_default_io = %d\n", pthread_self(), io);
const struct iio_channel *chn;
const struct iio_device *dev;
const struct iio_buffer *buf;
Expand Down Expand Up @@ -1605,9 +1604,7 @@ void iiod_client_free_block(struct iio_block_pdata *block)
/* Cancel any I/O going on. This means we must send the block free
* command through the main I/O as the block's I/O stream is
* disrupted. */
printf("thread = %u, iiod_io_cancel...\n", pthread_self());
iiod_io_cancel(block->io);
printf("thread = %u, iiod_io_cancel ok\n", pthread_self());
iiod_io_unref(block->io);

io = iiod_responder_get_default_io(client->responder);
Expand Down
10 changes: 3 additions & 7 deletions iiod-responder.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct iiod_responder {
const struct iiod_responder_ops *ops;
void *d;

struct iiod_io *readers, *writers, *default_io;
struct iiod_io *readers, *writers;
struct iiod_io* default_io_pool[MAX_DEFAULT_IO_ELEMENTS];
uint64_t default_io_pool_thread_ids[MAX_DEFAULT_IO_ELEMENTS];
unsigned int default_io_pool_size;
Expand Down Expand Up @@ -168,9 +168,8 @@ static ssize_t iiod_rw_all(struct iiod_responder *priv,
nb = 1;
}

if (is_read) {
if (is_read)
ret = priv->ops->read(priv->d, curr, nb);
}
else
ret = priv->ops->write(priv->d, curr, nb);
if (ret <= 0)
Expand Down Expand Up @@ -294,7 +293,6 @@ static int iiod_responder_reader_worker(struct iiod_responder *priv)
ret = iiod_run_command(priv, &cmd);

iio_mutex_lock(priv->lock);

if (ret < 0)
break;

Expand All @@ -315,7 +313,6 @@ static int iiod_responder_reader_worker(struct iiod_responder *priv)
iio_mutex_unlock(priv->lock);
iiod_discard_data(priv, cmd.code);
iio_mutex_lock(priv->lock);

continue;
}

Expand Down Expand Up @@ -681,8 +678,7 @@ iiod_responder_create_io(struct iiod_responder *priv, uint16_t id)
void
iiod_responder_set_timeout(struct iiod_responder *priv, unsigned int timeout_ms)
{
// priv->timeout_ms = timeout_ms;
// priv->default_io->timeout_ms = timeout_ms;
priv->timeout_ms = timeout_ms;
}

void
Expand Down

0 comments on commit 3d007fe

Please sign in to comment.