[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.jdt] how to wait process created by DebugUITools.launch()

Hello,

First of all, my English is poor, please understand :)

I wanna read some result file,
which is created by launched process,
which is launched using DebugUITools.launch(..) method.

Because DebugUITools.launch() works asynchronously,
I made my app. wait till the target process ends, like this :



DebugUITools.launch(config, ILaunchManager.RUN_MODE);

IProcess cur = DebugUITools.getCurrentProcess();
if(waitResult) {
	while (!cur.isTerminated()) {
		try {
			Thread.sleep(100);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}



Is this code has any problem?

this code seems to work well on small processes,
but if process is big and takes long execution time, it seems like even the process doesn't start or process doesn't end forever, so my app. wait forever.


the target process itself has no problem.
if do not wait till the process ends (waitResult == false), target process is executed well(it prints entry message) and write execution result(Map) to file.


I can't use file's existence, cause some target process write result file, but othes not.

How can I determine the termination of process properly?


Regards