1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

Declare a boolean variable to set if the session was terminated.

This commit is contained in:
Alain Magloire 2002-10-10 22:05:53 +00:00
parent b3ae7fedaa
commit 96ac0e81e6

View file

@ -47,6 +47,7 @@ public class MISession extends Observable {
*/ */
public static long REQUEST_TIMEOUT = 10000; // 10 * 1000 (~ 10 secs); public static long REQUEST_TIMEOUT = 10000; // 10 * 1000 (~ 10 secs);
boolean terminated;
// hold the type of the session(post-mortem, attach etc ..) // hold the type of the session(post-mortem, attach etc ..)
int sessionType; int sessionType;
@ -285,7 +286,7 @@ public class MISession extends Observable {
* Check if the gdb session is terminated. * Check if the gdb session is terminated.
*/ */
public boolean isTerminated() { public boolean isTerminated() {
return (!txThread.isAlive() || !rxThread.isAlive()); return terminated;
} }
/** /**
@ -293,9 +294,16 @@ public class MISession extends Observable {
*/ */
public void terminate() { public void terminate() {
// Sanity check.
if (isTerminated()) {
return;
}
terminated = true;
// Destroy any MI Inferior(Process) and streams. // Destroy any MI Inferior(Process) and streams.
inferior.destroy(); inferior.destroy();
// Tell the observers that the session // Tell the observers that the session
// is finish, but we can not use the Event Thread. // is finish, but we can not use the Event Thread.
// The Event Thread is being kill below. // The Event Thread is being kill below.