Termination of outputLoop is triggered when inputLoop exits.
Safer signaling to outputLoop termination.