new(*args) public

Creates a new thread executing the given block.

Any args given to ::new will be passed to the block:

arr = []
a, b, c = 1, 2, 3,b,c) { |d,e,f| arr << d << e << f }.join
arr #=> [1, 2, 3]

A ThreadError exception is raised if ::new is called without a block.

If you’re going to subclass Thread, be sure to call super in your initialize method, otherwise a ThreadError will be raised.

Show source
Register or log in to add new notes.