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:
parent
b3ae7fedaa
commit
96ac0e81e6
1 changed files with 10 additions and 2 deletions
|
@ -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.
|
||||||
|
|
Loading…
Add table
Reference in a new issue