public void OnCompleted() { lock (parent.gate) { parent.rightCompleted = true; if (parent.leftCompleted) { parent.OnCompleted(); } } }
public void OnCompleted() { lock (parent.gate) { parent.isCompleted[index] = true; bool flag = true; for (int i = 0; i < parent.length; i++) { if (!parent.isCompleted[i]) { flag = false; break; } } if (flag) { parent.OnCompleted(); } } }
public void OnCompleted() { lock (parent.gate) { parent.isCompleted[index] = true; var allTrue = true; for (int i = 0; i < parent.length; i++) { if (!parent.isCompleted[i]) { allTrue = false; break; } } if (allTrue) { parent.OnCompleted(); } } }