* JobQueue: Synch fix (ticket #670)

This commit is contained in:
zzz
2012-08-03 11:21:28 +00:00
parent e4f141b94c
commit 4d32eaa036

View File

@ -211,10 +211,14 @@ public class JobQueue {
/**
* Returns <code>true</code> if a given job is waiting or running;
* <code>false</code> if the job is finished or doesn't exist in the queue.
*
* Only used by PluginStarter, candidate for deprecation
*/
public boolean isJobActive(Job job) {
if (_readyJobs.contains(job) || _timedJobs.contains(job))
return true;
synchronized (_jobLock) {
if (_readyJobs.contains(job) || _timedJobs.contains(job))
return true;
}
for (JobQueueRunner runner: _queueRunners.values())
if (runner.getCurrentJob() == job)
return true;