// Get a snapshot of the queue
WrappedTask[] queueSnapshot = taskQueue.getQueueSnapshot();
// Obtain the settings of max concurrent threads
NumOfThreadsParameter parameter = MZmineCore.getConfiguration()
.getPreferences()
.getParameter(MZminePreferences.numOfThreads);
int maxRunningThreads;
if (parameter.isAutomatic() || (parameter.getValue() == null))
maxRunningThreads = Runtime.getRuntime().availableProcessors();
else
maxRunningThreads = parameter.getValue();
// Check all tasks in the queue
for (WrappedTask task : queueSnapshot) {
// Skip assigned and canceled tasks