提交 cd92a6ba 编写于 作者: K kohsuke

return an indicator value.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3586 71c3de6d-444a-0410-be80-ed276b4c234a
上级 25e24afa
......@@ -198,17 +198,24 @@ public class Queue {
return true;
}
public synchronized void cancel( AbstractProject<?,?> p ) {
/**
* Cancels the item in the queue.
*
* @return
* true if the project was indeed in the queue and was removed.
* false if this was no-op.
*/
public synchronized boolean cancel( AbstractProject<?,?> p ) {
LOGGER.fine("Cancelling "+p.getName());
for (Iterator itr = queue.iterator(); itr.hasNext();) {
Item item = (Item) itr.next();
if(item.task ==p) {
itr.remove();
return;
return true;
}
}
blockedProjects.remove(p);
buildables.remove(p);
// use bitwise-OR to make sure that both branches get evaluated all the time
return blockedProjects.remove(p)|buildables.remove(p);
}
public synchronized boolean isEmpty() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册