- Timestamp:
- 2017-05-31T18:05:11+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/util/SafeProcess.java
r31716 r31718 163 163 * This method returns a boolean that you can call sentInterrupt. 164 164 */ 165 public boolean cancelRunningProcess() { 165 public boolean cancelRunningProcess() { 166 166 167 167 boolean forceWaitUntilInterruptible = true; … … 922 922 */ 923 923 924 if(pid == -1) { 924 if(pid == -1) { // if the process has already terminated, or we can't get the pid for any reason: 925 925 p.destroy(); // at minimum. Will have no effect if the process had already terminated 926 926 } else { … … 930 930 if(!killUnixProcessWithID(pid, !forceKill, killEntireProcessTree)) { // send sig TERM (kill -15 or kill -TERM) 931 931 killUnixProcessWithID(pid, forceKill, killEntireProcessTree); // send sig KILL (kill -9 or kill -KILL) 932 } 932 } 933 // if both kill commands failed for whatever reason, can still at least end the top level process: 934 p.destroy(); // no effect if the process has already terminated. 933 935 } 934 936
Note:
See TracChangeset
for help on using the changeset viewer.