From 444f4ebe9de8aa68afdf8d39b734a8543b9b5c4b Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 2 Nov 2023 09:53:54 +0800 Subject: refactor: improve code quanity (#196) - rewrite Repl, remove ReplHandler - move ReplyStreamHandler to repl/ and rename it to ReplyHandler - deprecate utils::print_now - refactor session info --- src/repl/abort.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/repl/abort.rs') diff --git a/src/repl/abort.rs b/src/repl/abort.rs index f76abb6..af58b35 100644 --- a/src/repl/abort.rs +++ b/src/repl/abort.rs @@ -3,15 +3,19 @@ use std::sync::{ Arc, }; -pub type SharedAbortSignal = Arc; +pub type AbortSignal = Arc; -pub struct AbortSignal { +pub struct AbortSignalInner { ctrlc: AtomicBool, ctrld: AtomicBool, } -impl AbortSignal { - pub fn new() -> SharedAbortSignal { +pub fn create_abort_signal() -> AbortSignal { + AbortSignalInner::new() +} + +impl AbortSignalInner { + pub fn new() -> AbortSignal { Arc::new(Self { ctrlc: AtomicBool::new(false), ctrld: AtomicBool::new(false), -- cgit v1.2.3