Rewrite to select
For concurrency and synchronization issues we need a new approach. The select() function and additional pipes should be sufficient to timeout and synchronize the TX source and Rx sink thread.
Yet a bit unpolished.
Edited by Felix Gerking