Task task = new Task();
task.count = 100;
Semaphore semaphore = new Semaphore();
Thread generatorThread = new Generator(task, semaphore, "Generator");
//generatorThread.setPriority(Thread.MAX_PRIORITY);
Thread integratorThread = new Integrator(task, semaphore, "Integrator");
//integratorThread.setPriority(Thread.MAX_PRIORITY);
//System.err.println("" + generatorThread.getPriority() + " " + integratorThread.getPriority());
generatorThread.start();
integratorThread.start();
try {
Thread.sleep(50);
} catch (InterruptedException ex) {
System.err.println(ex);
}
generatorThread.interrupt();
integratorThread.interrupt();
}