🐛 fix(async_executor): implement cooperative cancellation
This commit is contained in:
@@ -176,7 +176,7 @@ namespace lsp::test::provider
|
||||
struct ProviderEnv
|
||||
{
|
||||
std::vector<core::ServerLifecycleEvent> events;
|
||||
scheduler::AsyncExecutor scheduler{ 1 };
|
||||
scheduler::async_executor::AsyncExecutor scheduler{ 1 };
|
||||
manager::ManagerHub hub{};
|
||||
core::ExecutionContext context;
|
||||
|
||||
@@ -3426,7 +3426,7 @@ namespace lsp::test::provider
|
||||
ProviderEnv env;
|
||||
|
||||
std::atomic<bool> started{ false };
|
||||
env.scheduler.Submit("cancel_me", [&started]() -> std::optional<std::string> {
|
||||
env.scheduler.Submit("cancel_me", [&started](std::stop_token) -> std::optional<std::string> {
|
||||
started.store(true);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
return std::string("done");
|
||||
|
||||
Reference in New Issue
Block a user