From 60754252d897ea7a454318c96d13c481c29b5243 Mon Sep 17 00:00:00 2001 From: Brian Shirai Date: Thu, 9 Apr 2015 16:34:46 -0700 Subject: [PATCH] Removed Thread 'dying' attribute. There is no Thread API to put a thread into a 'dying' state, so any such possible observation of a thread is a non-deterministic race. --- kernel/bootstrap/thread.rb | 7 +------ vm/builtin/thread.cpp | 1 - vm/builtin/thread.hpp | 2 -- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/kernel/bootstrap/thread.rb b/kernel/bootstrap/thread.rb index 85b0cacc48..78497887cd 100644 --- a/kernel/bootstrap/thread.rb +++ b/kernel/bootstrap/thread.rb @@ -194,8 +194,6 @@ def status if @alive if @sleep "sleep" - elsif @dying - "aborting" else "run" end @@ -421,9 +419,7 @@ def __run__ end end rescue Exception => e - # I don't really get this, but this is MRI's behavior. If we're dying - # by request, ignore any raised exception. - exception = e # unless @dying + exception = e ensure unless exception && (abort_on_exception || Thread.abort_on_exception) @exception = exception @@ -445,7 +441,6 @@ def __run__ end def kill - @dying = true @sleep = false Rubinius.synchronize(self) do kill_prim diff --git a/vm/builtin/thread.cpp b/vm/builtin/thread.cpp index 46d6f96740..5eb9f07e7a 100644 --- a/vm/builtin/thread.cpp +++ b/vm/builtin/thread.cpp @@ -67,7 +67,6 @@ namespace rubinius { thr->result(state, cFalse); thr->exception(state, nil()); thr->critical(state, cFalse); - thr->dying(state, cFalse); thr->joins(state, Array::create(state, 1)); thr->killed(state, cFalse); thr->priority(state, Fixnum::from(0)); diff --git a/vm/builtin/thread.hpp b/vm/builtin/thread.hpp index 9119d62cf1..337fb27016 100644 --- a/vm/builtin/thread.hpp +++ b/vm/builtin/thread.hpp @@ -44,7 +44,6 @@ namespace rubinius { Object* result_; // slot Exception* exception_; // slot Object* critical_; // slot - Object* dying_; // slot Array* joins_; // slot Object* killed_; // slot Fixnum* priority_; // slot @@ -84,7 +83,6 @@ namespace rubinius { attr_accessor(result, Object); attr_accessor(exception, Exception); attr_accessor(critical, Object); - attr_accessor(dying, Object); attr_accessor(joins, Array); attr_accessor(killed, Object); attr_accessor(priority, Fixnum);