/// <summary><para> /// Calls `fn` for each sub-node (in order of their appearance in source code). /// </para><para> /// If provided, `st` maintains a stack/history of nested nodes, allowing to check for parents in `fn` /// </para></summary> public virtual void iter(IterFunc fn, List <Node> st = null) { seek((ref Node node, List <Node> st) => { fn(ref node, st); return(false); }, st); }
public Iterator(WriteableBitmap output, IterFunc func, double thresh, int maxIters) { this.output = output; this.func = func; this.thresh = thresh; this.maxIters = maxIters; for (int i = 0; i < Environment.ProcessorCount; i++) { ManualResetEvent syncEvent = new ManualResetEvent(false); syncEvents.Add(syncEvent); Thread thread = new Thread(Worker) { IsBackground = true, Name = $"JuliaSetRender Iterator Thread {i + 1}", Priority = ThreadPriority.AboveNormal, }; threads.Add(thread); thread.Start(new WorkerClosure(syncEvent, i)); } }