Skip to content
Browse files

Fix raising exception into root fiber when killing thread

Fixes #2392
  • Loading branch information...
1 parent 9efac8a commit 1bef67cc61b51f1e2a9fbbcf12a9ae9a4408b351 @dbussink dbussink committed Jun 24, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 vm/state.cpp
View
8 vm/state.cpp
@@ -2,6 +2,7 @@
#include "builtin/exception.hpp"
#include "builtin/location.hpp"
#include "builtin/array.hpp"
+#include "builtin/fiber.hpp"
#include "signal.hpp"
#include "call_frame.hpp"
@@ -40,7 +41,12 @@ namespace rubinius {
return false;
}
if(vm_->interrupt_by_kill()) {
- vm_->clear_interrupt_by_kill();
+ Fiber* fib = vm_->current_fiber.get();
+ if(fib->nil_p() || fib->root_p()) {
+ vm_->clear_interrupt_by_kill();
+ } else {
+ vm_->set_check_local_interrupts();
+ }
vm_->thread_state_.raise_thread_kill();
return false;
}

0 comments on commit 1bef67c

Please sign in to comment.
Something went wrong with that request. Please try again.