Bug 567345 follow-up: Remove unnecessary code in model.RuntimeProcess

Mainly simplify ProcessMonitorThread:

- Made it private (was package-private and not used in the package).

- Use the enclosing RuntimeProcess instance instead of passing 'this'.

- Do not check if fOSProcess respectively RuntimeProcess.this.fProcess
is null in a loop because at the end of the first pass in the finally
block both were/are set to null anyway (fOSProcess directly or fProcess
in RuntimeProcess.this.terminated())
- only check initially if os-process is null (null may be passed to
RuntimeProcess)

- simplify killThread() by just setting the (now volatile) fExit flag
and interrupting the thread in any case. The thread either notices
fExit=true (when killed before or immediately after becoming alive) or
the interruption (when already being alive).

All removed fields and methods were private or package private (or in a
package private class), so no API is changed.

- do not set 'fMonitor' field to null, in RuntimeProcess.terminate(). It
isn't nulled if the process terminates regularly either and their is no
semantic in doing it. And so the field can be final.

Change-Id: I68d079c1222b4af71d33758ca695cf1c1b5dcb38
Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
1 file changed