public void Cancel() { lock (this.syncRoot) { cancelled = true; tasks.Reset(); Monitor.Pulse(this.syncRoot); } }