]> sigrok.org Git - libsigrok.git/commit - src/hardware/demo/demo.c
sr: demodevice: Make read channel non-blocking
authorLars-Peter Clausen <redacted>
Fri, 6 Jul 2012 21:23:30 +0000 (23:23 +0200)
committerUwe Hermann <redacted>
Tue, 10 Jul 2012 18:13:31 +0000 (20:13 +0200)
commite6e8f8e0531805a9215eebcb0d4d270a5afa6a8d
tree580a137f2b0cda505a715bcee228673bfd409c61
parent93b03d091abb947fdf78e57f864313571fb903ab
sr: demodevice: Make read channel non-blocking

Both pipe channels are currently configured as blocking. We read from the pipe
in receive_data. Since the channel is configured as blocking we'll block in
receive_data until all data has been received. receive_data will be called from
the mainloop, so as consequence the mainloop will be blocked until the demo
device has finished sampling. This is not so much of a problem if we are
sampling in blocking mode (using sr_session_run()) and the demo device is the
only device in the session, but it will fail badly for all other configurations
(e.g. multiple devices or async sampling).

Signed-off-by: Lars-Peter Clausen <redacted>
hardware/demo/demo.c