🐛 fix(async_executor): implement cooperative cancellation

This commit is contained in:
csh
2026-07-13 16:03:56 +08:00
parent edea37202d
commit 89b8937697
17 changed files with 685 additions and 420 deletions
@@ -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");