wait for a child termination @param c the child to wait for @return the child exit code @throws InterruptedException if current thread gets interrupted while waiting @throws ChildDiedException if child has been killed by a signal
(Child c)
| 35 | * @throws ChildDiedException if child has been killed by a signal |
| 36 | */ |
| 37 | public static int wait(Child c) throws InterruptedException, ChildDiedException { |
| 38 | synchronized (children) { |
| 39 | while (c.running) |
| 40 | children.wait(); |
| 41 | } |
| 42 | |
| 43 | if(c.signal >= 0) { |
| 44 | throw new ChildDiedException(c.signal); |
| 45 | } |
| 46 | return c.exitValue; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * execute a command |
no outgoing calls
no test coverage detected