Skip to content

Commit

Permalink
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vm/builtin/thread.cpp
Original file line number Diff line number Diff line change
@@ -329,7 +329,7 @@ namespace rubinius {

shared.gc_independent();

vm->set_zombie();
vm->set_zombie(state);

RUBINIUS_THREAD_STOP(
const_cast<RBX_DTRACE_CHAR_P>(vm->name().c_str()), vm->thread_id(), 0);
3 changes: 3 additions & 0 deletions vm/internal_threads.cpp
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ namespace rubinius {

thread->run(state);

vm->set_call_frame(0);
thread->thread_running_ = false;

NativeMethod::cleanup_thread(state);
@@ -48,6 +49,8 @@ namespace rubinius {

shared.gc_independent();

vm->set_zombie(state);

return 0;
}

4 changes: 2 additions & 2 deletions vm/vm.cpp
Original file line number Diff line number Diff line change
@@ -107,14 +107,14 @@ namespace rubinius {

void VM::discard(STATE, VM* vm) {
vm->saved_call_frame_ = 0;
vm->shared.remove_vm(vm);

state->vm()->metrics().system.threads_destroyed++;

delete vm;
}

void VM::set_zombie() {
void VM::set_zombie(STATE) {
state->shared().remove_vm(this);
thread.set(nil<Thread>());
zombie_ = true;
}
2 changes: 1 addition & 1 deletion vm/vm.hpp
Original file line number Diff line number Diff line change
@@ -154,7 +154,7 @@ namespace rubinius {
return interrupt_lock_;
}

void set_zombie();
void set_zombie(STATE);

bool zombie_p() {
return zombie_;

0 comments on commit 1d60cbe

Please sign in to comment.