Skip to content

Commit

Permalink
Removed Thread 'dying' attribute.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brixen committed Apr 14, 2015
1 parent 50aa735 commit 6075425
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
7 changes: 1 addition & 6 deletions kernel/bootstrap/thread.rb
Expand Up @@ -194,8 +194,6 @@ def status
if @alive
if @sleep
"sleep"
elsif @dying
"aborting"
else
"run"
end
Expand Down Expand Up @@ -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
Expand All @@ -445,7 +441,6 @@ def __run__
end

def kill
@dying = true
@sleep = false
Rubinius.synchronize(self) do
kill_prim
Expand Down
1 change: 0 additions & 1 deletion vm/builtin/thread.cpp
Expand Up @@ -67,7 +67,6 @@ namespace rubinius {
thr->result(state, cFalse);
thr->exception(state, nil<Exception>());
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));
Expand Down
2 changes: 0 additions & 2 deletions vm/builtin/thread.hpp
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6075425

Please sign in to comment.