Skip to content

Commit

Permalink
Clean up flags for interrupt handler (#263)
Browse files Browse the repository at this point in the history
* clean up flags for interrupt handler

* remove print
  • Loading branch information
mattwparas authored Aug 21, 2024
1 parent c057a36 commit fc15f5d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ path = "src/main.rs"
steel-core = { path = "./crates/steel-core", version = "0.6.0", features = ["dylibs", "markdown", "stacker", "dylib-build"] }

[features]
interrupt = ["steel-core/interrupt"]
interrupt = ["steel-core/interrupt", "steel-repl/interrupt"]

[dependencies]
once_cell = "1.17.0"
Expand Down
3 changes: 3 additions & 0 deletions crates/steel-repl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ steel-core = { workspace = true }
steel-parser = { path = "../steel-parser", version = "0.6.0"}
dirs = "5.0.1"
ctrlc = "3.4.4"

[features]
interrupt = ["steel-core/interrupt"]
2 changes: 2 additions & 0 deletions crates/steel-repl/src/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ pub fn repl_base(mut vm: Engine) -> std::io::Result<()> {
// true
// });

#[cfg(feature = "interrupt")]
{
let interrupted = interrupted.clone();

Expand All @@ -196,6 +197,7 @@ pub fn repl_base(mut vm: Engine) -> std::io::Result<()> {
}

let clear_interrupted = move || {
#[cfg(feature = "interrupt")]
interrupted.store(false, std::sync::atomic::Ordering::Relaxed);
};

Expand Down

0 comments on commit fc15f5d

Please sign in to comment.