message: Abort pending operations if pretranslation is cancelled
diff: @@ -589,6 +589,30 @@ inline auto on_main(F&& f) -> future<typename detail::future_unwrapper<typename
  }
  +
  +/// MT-safe token for cancelling long-running async operations.
  +class cancellation_token
  +{
  +public:
  + cancellation_token() : m_cancelled(false) {}
  +
  + /// Signal the operation to cancel when the return value is no longer wanted
  + void cancel() { m_cancelled = true; }
  +
  + /// Should the operation be cancelled?
  + bool is_cancelled() const { return m_cancelled; }
  +
  +private:
  + std::atomic_bool m_cancelled;
  +};
  +
  +/// Pointer to cancellation_token
  +typedef std::shared_ptr<cancellation_token> cancellation_token_ptr;
  +
  +
  +
  +
  +
  /// @internal Call on shutdown to terminate queues and close executors
  extern void cleanup();
  