|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
org.jruby.ThreadClass
Implementation of Ruby's Thread
class. Each Ruby thread is
mapped to an underlying Java Virtual Machine thread.
Thread encapsulates the behavior of a thread of execution, including the main
thread of the Ruby script. In the descriptions that follow, the parameter
aSymbol
refers to a symbol, which is either a quoted string or a
Symbol
(such as :name
).
Field Summary |
Fields inherited from class org.jruby.RubyObject |
runtime |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
NULL_ARRAY |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public static RubyClass createThreadClass(Ruby ruby)
public static IRubyObject newInstance(IRubyObject recv, IRubyObject[] args)
Thread.new
Thread.new( [ arg ]* ) {| args | block } -> aThread
Creates a new thread to execute the instructions given in block, and begins running it. Any arguments passed to Thread.new are passed into the block.
x = Thread.new { sleep .1; print "x"; print "y"; print "z" } a = Thread.new { print "a"; print "b"; sleep .2; print "c" } x.join # Let the threads finish before a.join # main thread exits...produces: abxyzc
public static ThreadClass start(IRubyObject recv, IRubyObject[] args)
public void pollThreadEvents()
public static RubyBoolean abort_on_exception(IRubyObject recv)
public static IRubyObject abort_on_exception_set(IRubyObject recv, IRubyObject value)
public static ThreadClass current(IRubyObject recv)
public static IRubyObject pass(IRubyObject recv)
public static RubyArray list(IRubyObject recv)
public IRubyObject aref(IRubyObject key)
public IRubyObject aset(IRubyObject key, IRubyObject value)
public RubyBoolean abort_on_exception()
public IRubyObject abort_on_exception_set(IRubyObject val)
public RubyBoolean is_alive()
public ThreadClass join()
public RubyBoolean has_key(IRubyObject key)
public RubyFixnum priority()
public IRubyObject priority_set(IRubyObject priority)
public IRubyObject raise(IRubyObject exc)
public IRubyObject status()
public static ThreadClass mainThread(IRubyObject receiver)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |