I have 3 Runnable tasks
PeriodRunnable runnableJob1 = new PeriodRunnable(driver, bolgaria);
PeriodRunnable runnableJob2 = new PeriodRunnable(driver, egipet);
PeriodRunnable runnableJob3 = new PeriodRunnable(driver, turc);
runnableJob1.run();
runnableJob2.run();
runnableJob3.run();
I set 'synchronized' for my object
public class PeriodRunnable implements Runnable{
private final PeriodCountdown counterdown;
public PeriodRunnable(WebDriver driver, PeriodTour periodTour) {
this.driver = driver;
this.periodTour = periodTour;
counterdown = new PeriodCountdown(driver, periodTour);
}
public void run() {
synchronized (counterdown){
counterdown.runCounter();
}
}
}
but my runnableJobs's starting work all together. What i'm doing wrong, tell me please?
Aucun commentaire:
Enregistrer un commentaire