hpcc-systems/HPCC-Platform — pull request #3569 by jakesmith (2012-10-23 10:19:24+00:00)
Title: HPCC-8120 Firstn deadlock

FirstN in combination with certain upstream activities can caused
a deadlock. The problem occurs, when the firstN lookahead hits
it's limit on some nodes and attempts to a) signal the next node
and b) wait for the reader to finish processing or signal stop
the rows it has buffered.
Either one can block, which will prevent the lookahead signalling
'stop' to input it has been reading on. In some circumstances
those inputs will be blocked themselves, e.g. because their
buffers are full, waiting for either read or stop signal.

Spin off the signal to next node and local row cache flush to
a separate thread, and allow the input stop to be called.

Signed-off-by: Jake Smith