Skip to content

Commit

Permalink
fix main thread getting stuck at interrupts
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwparas committed Oct 27, 2024
1 parent 9d1be8e commit e9079ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/steel-core/src/steel_vm/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,19 @@ impl SteelThread {
let res = finish(self);

if cfg!(feature = "sync") {
// Just block here until we're out
// Just block here until we're out - this only applies if we're not the main thread and
// not in garbage collection
while self
.synchronizer
.state
.paused
.load(std::sync::atomic::Ordering::Relaxed)
{
match self.synchronizer.state.state.load() {
ThreadState::Interrupted => break,
_ => {}
}

std::thread::park();
}

Expand Down

0 comments on commit e9079ab

Please sign in to comment.