mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-16 04:35:45 +02:00
Bug 365601: GUI can become unresponsive when starting a debug launch
This commit is contained in:
parent
273e46b409
commit
2507788546
1 changed files with 10 additions and 1 deletions
|
@ -16,6 +16,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.eclipse.cdt.dsf.concurrent.CountingRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
|
||||
|
@ -97,11 +99,18 @@ public class GdbConnectCommand implements IConnect {
|
|||
};
|
||||
try {
|
||||
fExecutor.execute(canConnectQuery);
|
||||
return canConnectQuery.get();
|
||||
return canConnectQuery.get(50, TimeUnit.MILLISECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
} catch (ExecutionException e) {
|
||||
} catch (RejectedExecutionException e) {
|
||||
// Can be thrown if the session is shutdown
|
||||
} catch (TimeoutException e) {
|
||||
// Bug 365601
|
||||
// Don't wait forever so as to not lock the UI and
|
||||
// potentially create a deadlock.
|
||||
// If we timeout, we just return false and disable
|
||||
// the connect command. The next call to this method
|
||||
// should succeed and fix this.
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue