public bool cancel() { // Already completed or cancelled. if (_t.Join(0)) return false; // Don't abort until the task thread has established its ThreadAbortException catch block. _started.WaitOne(); _t.Abort(); _t.Join(); return _cancelled; }
public void DerefThrowsAfterCancellation() { AFnImpl fn = new AFnImpl(); fn._fn0 = () => { while (true); }; Future f = new Future(fn); f.cancel(); f.deref(); }