public void onSlaveTerminated(Process process) { synchronized (mAlarm) { mExitStatus = process.getExitStatus(); if (!process.isRunning()) { mProcesses.remove(process); mZombies.add(process); mAlarm.alarm(); } } }
private Process findZombie(Pid pid) throws UnixException { Process process = mZombies.remove(pid); if (process != null) { return process; } if (!mProcesses.contains(pid)) { // Another thread got the zombie. throw new UnixException(Errno.ECHILD); } return null; }