summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ardill <andrew.ardill@gmail.com>2011-02-21 12:28:35 +1100
committerAndrew Ardill <andrew.ardill@gmail.com>2011-02-21 16:32:40 +1100
commit6269c1e633d6736cacc75c0a55f56fbf182fea88 (patch)
tree8c8bf595c73101b09d95dd7f429975ecd18906e3
parent6335a5af76f6035dcd02ee97b8069c40048af903 (diff)
downloadcraftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.tar
craftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.tar.gz
craftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.tar.lz
craftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.tar.xz
craftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.zip
implementation of isQueued()
-rw-r--r--src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 298c9724..334013a1 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -223,4 +223,18 @@ public class CraftScheduler implements BukkitScheduler, Runnable {
public boolean isCurrentlyRunning(int taskId){
return craftThreadManager.isAlive(taskId);
}
+
+ public boolean isQueued(int taskId) {
+ synchronized (schedulerQueue) {
+ Iterator<CraftTask> itr = schedulerQueue.keySet().iterator();
+ while (itr.hasNext()) {
+ CraftTask current = itr.next();
+ if (current.getIdNumber() == taskId) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
}