lib/polyphony/extensions/thread.rb
# call-seq:
#   thread.join -> result
#   thread.join(timeout) -> result
#   thread.await -> result
#   thread.await(timeout) -> result
# 
# Waits for the thread to terminate and returns its return value. If the
# thread terminated with an uncaught exception, it is propagated to the
# waiting fiber. If a timeout interval is specified, the thread will be
# terminated without propagating the timeout exception.
#
# @param timeout [Number] timeout interval
# @return [any] thread's return value


Waits for the thread to terminate and returns its return value. If the
thread terminated with an uncaught exception, it is propagated to the
waiting fiber. If a timeout interval is specified, the thread will be
terminated without propagating the timeout exception.
Waits for the thread to terminate and returns its return value . If the thread terminated with an uncaught exception it is propagated to the waiting fiber . If a timeout interval is specified the thread will be terminated without propagating the timeout exception .
def join(timeout = nil)
    watcher = Fiber.current.auto_watcher
    @finalization_mutex.synchronize do
      if @terminated
        @result.is_a?(Exception) ? (raise @result) : (return @result)
      else
        @join_wait_queue << watcher
      end
    end
    timeout ? move_on_after(timeout) { watcher.await } : watcher.await
  end
def join ( timeout = nil ) watcher = Fiber . current . auto_watcher @finalization_mutex . synchronize do if @terminated @result . is_a? ( Exception ) ? ( raise @result ) : ( return @result ) else @join_wait_queue << watcher end end timeout ? move_on_after ( timeout ) { watcher . await } : watcher . await end
call-seq:
thread.join -> result
thread.join(timeout) -> result
thread.await -> result
thread.await(timeout) -> result
call - seq : thread . join - > result thread . join ( timeout ) - > result thread . await - > result thread . await ( timeout ) - > result
thread's return value
thread ' s return value
any
timeout
None