lib/polyphony/extensions/thread.rb
# Runs the thread's block, handling any uncaught exceptions.
#
# @return [void]
Runs the thread's block, handling any uncaught exceptions.
Runs the thread ' s block handling any uncaught exceptions .
def execute
    raise_error = false
    begin
      @backend = Polyphony::Backend.new
    rescue Exception => e
      raise_error = true
      raise e
    end
    setup
    @ready = true
    result = @block.(*@args)
  rescue Polyphony::MoveOn, Polyphony::Terminate => e
    result = e.value
  rescue Exception => e
    raise_error ? (raise e) : (result = e)
  ensure
    @ready = true
    finalize(result)
  end
def execute raise_error = false begin @backend = Polyphony :: Backend . new rescue Exception => e raise_error = true raise e end setup @ready = true result = @block . ( * @args ) rescue Polyphony :: MoveOn , Polyphony :: Terminate => e result = e . value rescue Exception => e raise_error ? ( raise e ) : ( result = e ) ensure @ready = true finalize ( result ) end
Runs the thread's block, handling any uncaught exceptions.
Runs the thread ' s block handling any uncaught exceptions .
# backend must be created in the context of the new thread, therefore it # cannot be created in Thread#initialize
None
void