Clear queue and prevent new objects from being enqueued into the backing
queue in the following cases:

- The computation has been cancelled.
- The computation has been cancelled, but the computation thread is
  still running.
- The computation thread generated an exception.