Skip to content

Commit

Permalink
[provider] set the stop signal earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed May 2, 2024
1 parent 4eafae2 commit e939219
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/maple_core/src/stdio_server/provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ struct SearcherControl {

impl SearcherControl {
fn kill_in_background(self) {
self.stop_signal.store(true, Ordering::SeqCst);
if !self.join_handle.is_finished() {
self.stop_signal.store(true, Ordering::SeqCst);
// NOTE: The kill operation may take some time, using `spawn_block` to not block current thread.
tokio::task::spawn_blocking(move || {
self.join_handle.abort();
Expand Down

0 comments on commit e939219

Please sign in to comment.