Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
with
20 additions
and 6 deletions.
@@ -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 |