def start_job(command = nil)
@jobs_sync.synchronize(:EX) do
if command
return if command.active?
@waiting_jobs.delete command
else
command = @waiting_jobs.shift
return unless command
end
@active_jobs.push command
command.start
for job in @waiting_jobs.dup
start_job(job) if job.input == command
end
end
end