IIOD: Make RW thread faster
IIOD: Make RW thread faster

Since commit 2d23809, one problem of the RW thread was that it spent
quite some time sleeping.

If no client was asking for data, the RW thread would sleep for 1ms.
With applications doing high-speed streaming, chances are that the
request would come slightly after the thread was put to sleep, with now
way of waking it up but waiting 1ms, causing a big waste of time and
thus a performance rate way below the theorical maximum.

This commit removes the sleep, and uses a condition+mutex combo to
ensure that the RW thread will wake up as soon as a client makes a new
request.

Signed-off-by: Paul Cercueil <73d292422978d45c9eeef455bb1b24a0db453722@analog.com>

analogdevicesinc/libiio,analogdevicesinc/libiio,analogdevicesinc/libiio,analogdevicesinc/libiio