diff --git a/vm/builtin/thread.hpp b/vm/builtin/thread.hpp index f687a814ce..cdad77a821 100644 --- a/vm/builtin/thread.hpp +++ b/vm/builtin/thread.hpp @@ -3,6 +3,7 @@ #include "vm/exception.hpp" #include "vm/type_info.hpp" +#include "vm/signal.hpp" #include "builtin/object.hpp" #include "builtin/randomizer.hpp" @@ -76,6 +77,10 @@ namespace rubinius { return vm_; } + bool signal_handler_thread_p() { + return runner_ == handle_tramp; + } + public: /** diff --git a/vm/shared_state.cpp b/vm/shared_state.cpp index f0b7a4caab..b62432514f 100644 --- a/vm/shared_state.cpp +++ b/vm/shared_state.cpp @@ -17,6 +17,7 @@ #include "world_state.hpp" #include "builtin/randomizer.hpp" #include "builtin/array.hpp" +#include "builtin/thread.hpp" #ifdef ENABLE_LLVM #include "llvm/state.hpp" @@ -140,7 +141,10 @@ namespace rubinius { i != threads_.end(); ++i) { if(VM* vm = (*i)->as_vm()) { - threads->append(state, (Object*)vm->thread.get()); + Thread *thread = vm->thread.get(); + if(!thread->signal_handler_thread_p()) { + threads->append(state, (Object*)thread); + } } } return threads; diff --git a/vm/signal.hpp b/vm/signal.hpp index 24f00b018a..1aaa1d7556 100644 --- a/vm/signal.hpp +++ b/vm/signal.hpp @@ -13,6 +13,8 @@ namespace rubinius { struct CallFrame; class Thread; + Object* handle_tramp(STATE); + class SignalHandler : public Lockable { VM* target_; VM* self_;