public void Update() { if (bufferQueue.Count < n * 2) { reader.Update(); } }
void p_asyncWorker_DoWork(object sender, DoWorkEventArgs e) { while (!p_asyncWorker.CancellationPending) { if (bufferQueue.Count < (maxpoints * 1.6)) //to prevent too many points being buffered without being drawn { dataReader.Update(); } //System.Threading.Thread.Sleep(delay);//50 p_asyncWorker.ReportProgress(-1, null); //this delay here is used to prevent stack overflow error System.Threading.Thread.Sleep(delay);//50 } }
void asyncWorker_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker bwAsync = sender as BackgroundWorker; while (!bwAsync.CancellationPending) { //System.Threading.Thread.Sleep(200); dataReader.Update(); System.Threading.Thread.Sleep(600); } if (bwAsync.CancellationPending) { e.Cancel = true; } }
public void Update() { reader.Update(); }