protected Driver(string inputPath, string outputPath) { SourceFile = inputPath; ResultFile = outputPath; _readQueue = new SyncronizedQueue <byte[]>(); WriteQueue = new SyncronizedQueue <byte[]>(); _threadPool = new MyThreadPool(); }
private void buttonCreatePool_Click(object sender, EventArgs e) { int min = 0, max = 0; try { min = Int32.Parse(textBoxMin.Text); max = Int32.Parse(textBoxMax.Text); if (min > max || min <= 0) { throw new Exception("Значения введены неверно"); } ShowTasksMenu(); threadPool = new MyThreadPool(min, max); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static void Execute(this IMyThreadPool pool) { pool.Run(); pool.Wait(); }