Skip to content
Permalink
Browse files

Merge pull request #606 from modcloth/mbh/Thread.abort_on_exception

Implementing Thread.abort_on_exception and Thread#abort_on_exception
  • Loading branch information
alex committed Apr 12, 2013
2 parents caa417d + 96e35c6 commit 98dd89b8c7404f3bcb3706f6fc6741508947c455
Showing with 20 additions and 6 deletions.
  1. +1 −0 lib-topaz/bootstrap.rb
  2. +19 −0 lib-topaz/thread.rb
  3. +0 −6 spec/tags/core/thread/abort_on_exception_tags.txt
@@ -23,4 +23,5 @@
load_bootstrap.call("random.rb")
load_bootstrap.call("string.rb")
load_bootstrap.call("symbol.rb")
load_bootstrap.call("thread.rb")
load_bootstrap.call("top_self.rb")
@@ -0,0 +1,19 @@
class Thread
class << self
def abort_on_exception=(value)
@abort_on_exception = !!value
end

def abort_on_exception
@abort_on_exception ||= false
end
end

def abort_on_exception=(value)
@abort_on_exception = !!value
end

def abort_on_exception
@abort_on_exception ||= (Thread.abort_on_exception || false)
end
end
@@ -1,10 +1,4 @@
fails:Thread#abort_on_exception is false by default
fails:Thread#abort_on_exception is changeable to true or false
fails:Thread#abort_on_exception= when enabled and the thread dies due to an exception causes the main thread to raise that exception
fails:Thread.abort_on_exception is false by default
fails:Thread.abort_on_exception is changeable to true or false
fails:Thread.abort_on_exception= when enabled and a non-main thread dies due to an exception causes the main thread to raise that exception
fails:Thread#abort_on_exception returns true when #abort_on_exception= is passed true
fails:Thread#abort_on_exception= when enabled and the thread dies due to an exception causes the main thread to raise the exception raised in the thread
fails:Thread.abort_on_exception returns true when .abort_on_exception= is passed true
fails:Thread.abort_on_exception= when enabled and a non-main thread dies due to an exception causes the main thread to raise the exception raised in the thread

0 comments on commit 98dd89b

Please sign in to comment.
You can’t perform that action at this time.