Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 217034f9508f
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c0c3e793f255
Choose a head ref
  • 3 commits
  • 7 files changed
  • 1 contributor

Commits on Feb 4, 2015

  1. Copy the full SHA
    53538f9 View commit details
  2. Copy the full SHA
    2a73795 View commit details
  3. Fixed checking clang/clang++.

    brixen committed Feb 4, 2015
    Copy the full SHA
    c0c3e79 View commit details
Showing with 27 additions and 9 deletions.
  1. +2 −2 configure
  2. +12 −3 vm/builtin/thread.cpp
  3. +2 −0 vm/builtin/thread.hpp
  4. +0 −2 vm/shared_state.cpp
  5. +1 −0 vm/signal.cpp
  6. +1 −2 vm/vm.cpp
  7. +9 −0 vm/vm.hpp
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
@@ -700,12 +700,12 @@ int main() { LLVMContext &Context = getGlobalContext(); }
end

def default_cc
return 'clang' if `clang --version > /dev/null 2>&1`
return 'clang' if `clang --version > /dev/null 2>&1` && $?.success?
return 'gcc'
end

def default_cxx
return 'clang++' if `clang++ --version > /dev/null 2>&1`
return 'clang++' if `clang++ --version > /dev/null 2>&1` && $?.success?
return 'g++'
end

15 changes: 12 additions & 3 deletions vm/builtin/thread.cpp
Original file line number Diff line number Diff line change
@@ -80,12 +80,22 @@ namespace rubinius {

target->thread.set(thr);

if(!internal_thread) {
state->memory()->needs_finalization(thr, (FinalizerFunction)&Thread::finalize);
}

state->vm()->metrics()->system_metrics.vm_threads++;
state->vm()->metrics()->system_metrics.vm_threads_total++;

return thr;
}

void Thread::finalize(STATE, Thread* thread) {
if(thread->vm()->zombie_p()) {
VM::discard(state, thread->vm());
}
}

Object* send_run(STATE) {
return state->vm()->thread.get()->send(state, NULL, state->symbol("__run__"));
}
@@ -335,12 +345,11 @@ namespace rubinius {

execute_thread(state, vm);

vm->thread->vm_ = NULL;
VM::discard(state, vm);

shared.clear_critical(state);
shared.gc_independent();

vm->set_zombie();

RUBINIUS_THREAD_STOP(const_cast<RBX_DTRACE_CHAR_P>(thread_name.c_str()),
vm->thread_id(), 0);

2 changes: 2 additions & 0 deletions vm/builtin/thread.hpp
Original file line number Diff line number Diff line change
@@ -291,6 +291,8 @@ namespace rubinius {
static Thread* create(STATE, VM* target, Object* self, Run runner,
bool internal_thread = false);

static void finalize(STATE, Thread* thread);

int start_thread(STATE, const pthread_attr_t &attrs);
static void execute_thread(STATE, VM* vm);
static void* internal_thread(void*);
2 changes: 0 additions & 2 deletions vm/shared_state.cpp
Original file line number Diff line number Diff line change
@@ -206,8 +206,6 @@ namespace rubinius {

vm->unlock();
vm->reset_parked();

delete vm;
}
}
threads_.clear();
1 change: 1 addition & 0 deletions vm/signal.cpp
Original file line number Diff line number Diff line change
@@ -427,6 +427,7 @@ namespace rubinius {
logger::fatal("--- end system info ---");

logger::fatal("--- begin rubinius info ---");
logger::fatal("pid: %d", getpid());
logger::fatal("program name: %s", RBX_PROGRAM_NAME);
logger::fatal("version: %s", RBX_VERSION);
logger::fatal("ruby version: %s", RBX_RUBY_VERSION);
3 changes: 1 addition & 2 deletions vm/vm.cpp
Original file line number Diff line number Diff line change
@@ -75,6 +75,7 @@ namespace rubinius {
, tooling_env_(NULL)
, method_missing_reason_(eNone)
, constant_missing_reason_(vFound)
, zombie_(false)
, run_signals_(false)
, shared(shared)
, waiting_channel_(this, nil<Channel>())
@@ -104,10 +105,8 @@ namespace rubinius {
}

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

state->vm()->metrics()->system_metrics.vm_threads--;

9 changes: 9 additions & 0 deletions vm/vm.hpp
Original file line number Diff line number Diff line change
@@ -106,6 +106,7 @@ namespace rubinius {
MethodMissingReason method_missing_reason_;
ConstantMissingReason constant_missing_reason_;

bool zombie_;
bool run_signals_;
bool tooling_;
bool allocation_tracking_;
@@ -148,6 +149,14 @@ namespace rubinius {
return id_;
}

void set_zombie() {
zombie_ = true;
}

bool zombie_p() {
return zombie_;
}

bool run_signals_p() const {
return run_signals_;
}