Wrapper around
createProcess that prevents multiple processes
that are running concurrently from writing to stdout/stderr at the
same time.
If the process does not output to stdout or stderr, it's run by
createProcess entirely as usual. Only processes that can generate
output are handled specially:
A process is allowed to write to stdout and stderr in the usual way,
assuming it can successfully take the output lock.
When the output lock is held (ie, by another concurrent process, or
because
outputConcurrent is being called at the same time), the
process is instead run with its stdout and stderr redirected to a
buffer. The buffered output will be displayed as soon as the output
lock becomes free.
Note that the the process is waited for by a background thread, so
unlike createProcess, neglecting to call waitForProcess will not
result in zombie processess.