The mapgeneration read a value (if it should stop) set by the main thread. In a non syncronized way.
This diff introduces a general aproach to let the task react on stop requests.
The function object which is wrapped in the future now can accept a StopToken. It's simmilar to the std::stop_token.
For now a Future can't explicitly be requested to stop (I can't think of a situation where that's desired). It's only possible through CancelOrWait and by destructing the Future.