Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up all internal threads for C-API code.
Browse files Browse the repository at this point in the history
We may reduce this at some point, but allow C-API code to run on any thread for now.
brixen committed Feb 13, 2015
1 parent 7f9ba48 commit 24a8f29
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 0 additions & 4 deletions vm/gc/finalize.cpp
Original file line number Diff line number Diff line change
@@ -121,8 +121,6 @@ namespace rubinius {
void FinalizerThread::run(STATE) {
GCTokenImpl gct;

NativeMethod::init_thread(state);

metrics().init(metrics::eFinalizerMetrics);

state->gc_dependent(gct, 0);
@@ -158,8 +156,6 @@ namespace rubinius {
finalize(state);
next_process_item();
}

NativeMethod::cleanup_thread(state);
}

void FinalizerThread::finalize(STATE) {
7 changes: 6 additions & 1 deletion vm/internal_threads.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include "vm.hpp"
#include "prelude.hpp"
#include "environment.hpp"

#include "internal_threads.hpp"

#include "builtin/native_method.hpp"

#include "dtrace/dtrace.h"
#include "util/logger.hpp"

@@ -38,12 +39,16 @@ namespace rubinius {
RUBINIUS_THREAD_START(const_cast<RBX_DTRACE_CHAR_P>(thread_name),
vm->thread_id(), 1);

NativeMethod::init_thread(state);

thread->thread_running_ = true;

thread->run(state);

thread->thread_running_ = false;

NativeMethod::cleanup_thread(state);

RUBINIUS_THREAD_STOP(const_cast<RBX_DTRACE_CHAR_P>(thread_name),
vm->thread_id(), 1);

0 comments on commit 24a8f29

Please sign in to comment.