ConcurrentModificationException on queue: synchronized added.
| | |
| | | } |
| | | |
| | | public Iterator<AbstractJob<T>> getQueueIterator() { |
| | | synchronized (queue) { |
| | | return Collections.unmodifiableList(queue).iterator(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Searches only for queued jobs (not done jobs). |
| | |
| | | * @return The job if any job with the given unique job number is queued, otherwise null. |
| | | */ |
| | | public AbstractJob<T> getQueuedJobByUniqueJobNumber(long uniqueJobNumber) { |
| | | synchronized (queue) { |
| | | Iterator<AbstractJob<T>> it = queue.iterator(); |
| | | while (it.hasNext()) { |
| | | AbstractJob<T> job = it.next(); |
| | |
| | | return job; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |