title: Stopping a task without a CancellationToken
body: <p>I am using an external library that has <code>async</code> methods, but not <code>CancellationToken</code> overloads.</p>
  
  <p>Now currently I am using an extension method from another StackOverflow question to add a <code>CancellationToken</code>:</p>
  
  <pre><code>    public async static Task HandleCancellation(this Task asyncTask, CancellationToken cancellationToken)
      {
          // Create another task that completes as soon as cancellation is requested. http://stackoverflow.com/a/18672893/1149773
          TaskCompletionSource&lt;bool&gt; tcs = new TaskCompletionSource&lt;bool&gt;();
          cancellationToken.Register(() =&gt;
              tcs.TrySetCanceled(), useSynchronizationContext: false);
          Task cancellationTask = tcs.Task;
  
          // Create a task that completes when either the async operation completes, or
          // cancellation is requested.
          Task readyTask = await Task.WhenAny(asyncTask, cancellationTask);
  
          // In case of cancellation, register a continuation to observe any unhandled exceptions
          // from the asynchronous operation (once it completes). In .NET 4.0, unobserved task
          // exceptions would terminate the process.
          if (readyTask == cancellationTask)
              asyncTask.ContinueWith(_ =&gt; asyncTask.Exception,
                  TaskContinuationOptions.OnlyOnFaulted |
                  TaskContinuationOptions.ExecuteSynchronously);
  
          await readyTask;
      }
  </code></pre>
  
  <p>However the underlying task still executes to completion. This wouldn't be much of a problem, but sometimes the underlying task never completes and consumes 99% of my CPU.</p>
  
  <p>Is there any way to "kill" the task without killing the process?</p>