1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

New method clearCommands.

This commit is contained in:
Alain Magloire 2002-10-13 02:27:01 +00:00
parent 8ec3ec5b4e
commit 7f4456c0db

View file

@ -9,7 +9,7 @@ import org.eclipse.cdt.debug.mi.core.command.Command;
/**
* Simple thread-safe Queue implemetation.
*/
public class CommandQueue extends Queue{
public class CommandQueue extends Queue {
public CommandQueue() {
@ -42,6 +42,13 @@ public class CommandQueue extends Queue{
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) {
String name = Thread.currentThread().getName();
System.out.println(name + ": " + msg);