private static void finWork() { lock (lock2) { Interfaces.updateProgress(++fin, end); } if (fin == end) { Config.unlockConfig(); } }
public static void startProgress() { Config.lockConfig(); off = Config.getStart(); end = Config.getEnd() - off + 1; fin = current = 0; Interfaces.updateProgress(0, end); threads = Config.getThreads(); for (int i = 0; i < threads; ++i) { Thread t = new Thread(new ThreadStart(process)); t.Name = "PictureDownloader Processer #" + i; t.Start(); } }