public void FinishedProcessingPath(aPathResult result) { lock (results) { results.Enqueue(result); } }
private void Update() { if (results.Count > 0) { int itmsInQueue = results.Count; lock (results) { for (int i = 0; i < itmsInQueue; i++) { aPathResult result = results.Dequeue(); result.callback(result.path, result.succes); } } } }