mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-09 11:33:20 +02:00
New method clearCommands.
This commit is contained in:
parent
8ec3ec5b4e
commit
7f4456c0db
1 changed files with 8 additions and 1 deletions
|
@ -9,7 +9,7 @@ import org.eclipse.cdt.debug.mi.core.command.Command;
|
||||||
/**
|
/**
|
||||||
* Simple thread-safe Queue implemetation.
|
* Simple thread-safe Queue implemetation.
|
||||||
*/
|
*/
|
||||||
public class CommandQueue extends Queue{
|
public class CommandQueue extends Queue {
|
||||||
|
|
||||||
|
|
||||||
public CommandQueue() {
|
public CommandQueue() {
|
||||||
|
@ -42,6 +42,13 @@ public class CommandQueue extends Queue{
|
||||||
addItem(cmd);
|
addItem(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Command[] clearCommands() {
|
||||||
|
Object[] objs = clearItems();
|
||||||
|
Command[] cmds = new Command[objs.length];
|
||||||
|
System.arraycopy(objs, 0, cmds, 0, objs.length);
|
||||||
|
return cmds;
|
||||||
|
}
|
||||||
|
|
||||||
private static void print(String msg) {
|
private static void print(String msg) {
|
||||||
String name = Thread.currentThread().getName();
|
String name = Thread.currentThread().getName();
|
||||||
System.out.println(name + ": " + msg);
|
System.out.println(name + ": " + msg);
|
||||||
|
|
Loading…
Add table
Reference in a new issue