facebook/xctool — pull request #89 by yiding (2013-06-27 22:41:58+00:00)
Title: fix sporatic hanging in run-tests with parallelization

NSTask registers some mach ports with the current run loop on launch but
does not remove them until finalize. Sometimes the run loop will try to
read from these ports for reasons beyond my comprehension even after the
task exited, and hang there ad infinitum.

Here I change all NSTask uses to release as soon as possible. This seems
to resolve the issue (1/3 chance to < 1/20 chance in some tests I ran).

Also wrapped `readTillEndOfFileInBackgroundAndNotify` calls to inside
the runloop, per documentation.