| java.lang.Object org.jruby.RubyObject org.jruby.RubyThread
RubyThread | public class RubyThread extends RubyObject (Code) | | 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 ).
Note: For CVS history, see ThreadClass.java.
|
Method Summary | |
public static RubyBoolean | abort_on_exception(IRubyObject recv) Returns the status of the global ``abort on exception'' condition. | public RubyBoolean | abort_on_exception() | public static IRubyObject | abort_on_exception_set(IRubyObject recv, IRubyObject value) | public IRubyObject | abort_on_exception_set(IRubyObject val) | public static RubyThread | adopt(IRubyObject recv, Thread t) | public IRubyObject | aref(IRubyObject key) | public IRubyObject | aset(IRubyObject key, IRubyObject value) | public void | cleanTerminate(IRubyObject result) | public static RubyClass | createThreadClass(Ruby runtime) | public static IRubyObject | critical(IRubyObject receiver) | public static IRubyObject | critical_set(IRubyObject receiver, RubyBoolean value) | public static RubyThread | current(IRubyObject recv) | public void | exceptionRaised(RaiseException exception) | public IRubyObject | exit() | public IRubyObject | group() | public RubyBoolean | has_key(IRubyObject key) | public IRubyObject | initialize(IRubyObject[] args, Block block) | public IRubyObject | inspect() | public RubyBoolean | isStopped() | public RubyBoolean | is_alive() | public RubyThread | join(IRubyObject[] args) | public RubyArray | keys() | public IRubyObject | kill() | public static RubyArray | list(IRubyObject recv) | public static RubyThread | main(IRubyObject recv) | public static RubyThread | mainThread(IRubyObject receiver) | public static IRubyObject | newInstance(IRubyObject recv, IRubyObject[] args, Block block) Thread.new
Thread.new( [ arg ]* ) {| args | block } -> aThread
Creates a new thread to execute the instructions given in block, and
begins running it. | public static IRubyObject | pass(IRubyObject recv) | public void | pollThreadEvents() | public RubyFixnum | priority() | public IRubyObject | priority_set(IRubyObject priority) | public IRubyObject | raise(IRubyObject[] args, Block block) | public IRubyObject | run() | public static IRubyObject | s_exit(IRubyObject receiver, Block block) | public static IRubyObject | s_kill(IRubyObject receiver, RubyThread rubyThread, Block block) | void | setThreadGroup(RubyThreadGroup rubyThreadGroup) | public void | sleep(long millis) | public static RubyThread | start(IRubyObject recv, IRubyObject[] args, Block block) Basically the same as Thread.new . | public IRubyObject | status() | public static IRubyObject | stop(IRubyObject receiver) | public IRubyObject | value() | public RubyThread | wakeup() |
lock | final public ReentrantLock lock(Code) | | |
abort_on_exception | public static RubyBoolean abort_on_exception(IRubyObject recv)(Code) | | Returns the status of the global ``abort on exception'' condition. The
default is false. When set to true, will cause all threads to abort (the
process will exit(0)) if an exception is raised in any thread. See also
Thread.abort_on_exception= .
|
newInstance | public static IRubyObject newInstance(IRubyObject recv, IRubyObject[] args, Block block)(Code) | | 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
|
pollThreadEvents | public void pollThreadEvents()(Code) | | |
start | public static RubyThread start(IRubyObject recv, IRubyObject[] args, Block block)(Code) | | Basically the same as Thread.new . However, if class Thread is
subclassed, then calling start in that subclass will not invoke the
subclass's initialize method.
|
Methods inherited from org.jruby.RubyObject | public void addFinalizer(RubyProc finalizer)(Code)(Java Doc) public IRubyObject anyToString()(Code)(Java Doc) public RubyString asString()(Code)(Java Doc) public String asSymbol()(Code)(Java Doc) public void attachToObjectSpace()(Code)(Java Doc) public void callInit(IRubyObject[] args, Block block)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, String name, IRubyObject[] args)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, String name, IRubyObject[] args, Block block)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, String name, IRubyObject[] args, CallType callType)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, String name, IRubyObject[] args, CallType callType, Block block)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, int methodIndex, String name, IRubyObject arg)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, int methodIndex, String name, IRubyObject[] args)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, int methodIndex, String name, IRubyObject[] args, CallType callType)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, String name, IRubyObject[] args, CallType callType)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, String name, IRubyObject[] args, CallType callType, Block block)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, String name, IRubyObject[] args, CallType callType, Block block)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, String name)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, int methodIndex, String name)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, String name, Block block)(Code)(Java Doc) public IRubyObject callMethod(ThreadContext context, String name, IRubyObject arg)(Code)(Java Doc) public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject receiver, DynamicMethod method, String name, int methodIndex, IRubyObject[] args, IRubyObject self, CallType callType, Block block)(Code)(Java Doc) public static IRubyObject callMethodMissing(ThreadContext context, IRubyObject receiver, DynamicMethod method, String name, IRubyObject[] args, IRubyObject self, CallType callType, Block block)(Code)(Java Doc) public IRubyObject callSuper(ThreadContext context, IRubyObject[] args, Block block)(Code)(Java Doc) public IRubyObject checkArrayType()(Code)(Java Doc) protected void checkFrozen()(Code)(Java Doc) public IRubyObject checkStringType()(Code)(Java Doc) public IRubyObject compilerCallMethod(ThreadContext context, String name, IRubyObject[] args, IRubyObject self, CallType callType, Block block)(Code)(Java Doc) public IRubyObject compilerCallMethodWithIndex(ThreadContext context, int methodIndex, String name, IRubyObject[] args, IRubyObject self, CallType callType, Block block)(Code)(Java Doc) public RubyArray convertToArray()(Code)(Java Doc) public RubyFloat convertToFloat()(Code)(Java Doc) public RubyHash convertToHash()(Code)(Java Doc) public RubyInteger convertToInteger()(Code)(Java Doc) public RubyString convertToString()(Code)(Java Doc) public IRubyObject convertToType(RubyClass targetType, int convertMethodIndex, String convertMethod, boolean raise)(Code)(Java Doc) public IRubyObject convertToType(RubyClass targetType, int convertMethodIndex, boolean raise)(Code)(Java Doc) public IRubyObject convertToType(RubyClass targetType, int convertMethodIndex, String convertMethod, boolean raiseOnMissingMethod, boolean raiseOnWrongTypeResult, boolean allowNilThrough)(Code)(Java Doc) public IRubyObject convertToTypeWithCheck(RubyClass targetType, int convertMethodIndex, String convertMethod)(Code)(Java Doc) public static RubyClass createObjectClass(Ruby runtime, RubyClass objectClass)(Code)(Java Doc) public synchronized Object dataGetStruct()(Code)(Java Doc) public synchronized void dataWrapStruct(Object obj)(Code)(Java Doc) public IRubyObject display(IRubyObject[] args)(Code)(Java Doc) protected IRubyObject doClone()(Code)(Java Doc) public IRubyObject dup()(Code)(Java Doc) public boolean eql(IRubyObject other)(Code)(Java Doc) final public boolean eqlInternal(ThreadContext context, IRubyObject other)(Code)(Java Doc) public IRubyObject equal(IRubyObject other)(Code)(Java Doc) final public IRubyObject equalInternal(ThreadContext context, IRubyObject other)(Code)(Java Doc) public boolean equals(Object other)(Code)(Java Doc) public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file)(Code)(Java Doc) public IRubyObject evalUnder(RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line)(Code)(Java Doc) public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file, int lineNumber)(Code)(Java Doc) public IRubyObject extend(IRubyObject[] args)(Code)(Java Doc) public IRubyObject freeze()(Code)(Java Doc) public RubyBoolean frozen()(Code)(Java Doc) public IRubyObject getInstanceVariable(String name)(Code)(Java Doc) public Map getInstanceVariables()(Code)(Java Doc) public Map getInstanceVariablesSnapshot()(Code)(Java Doc) public Class getJavaClass()(Code)(Java Doc) final public RubyClass getMetaClass()(Code)(Java Doc) public int getNativeTypeIndex()(Code)(Java Doc) public Ruby getRuntime()(Code)(Java Doc) public RubyClass getSingletonClass()(Code)(Java Doc) public RubyClass getSingletonClassClone()(Code)(Java Doc) public RubyClass getType()(Code)(Java Doc) public RubyFixnum hash()(Code)(Java Doc) public int hashCode()(Code)(Java Doc) public synchronized RubyFixnum id()(Code)(Java Doc) public synchronized RubyFixnum id_deprecated()(Code)(Java Doc) public IRubyObject infectBy(IRubyObject obj)(Code)(Java Doc) public IRubyObject inherited(IRubyObject arg, Block block)(Code)(Java Doc) public static void initCopy(IRubyObject clone, IRubyObject original)(Code)(Java Doc) public IRubyObject initialize(IRubyObject[] args, Block block)(Code)(Java Doc) public IRubyObject initialize_copy(IRubyObject original)(Code)(Java Doc) public IRubyObject inspect()(Code)(Java Doc) public Iterator instanceVariableNames()(Code)(Java Doc) public IRubyObject instance_eval(IRubyObject[] args, Block block)(Code)(Java Doc) public IRubyObject instance_exec(IRubyObject[] args, Block block)(Code)(Java Doc) public RubyBoolean instance_of(IRubyObject type)(Code)(Java Doc) public IRubyObject instance_variable_get(IRubyObject var)(Code)(Java Doc) public IRubyObject instance_variable_set(IRubyObject var, IRubyObject value)(Code)(Java Doc) public RubyArray instance_variables()(Code)(Java Doc) final public boolean isFalse()(Code)(Java Doc) public boolean isFrozen()(Code)(Java Doc) public boolean isImmediate()(Code)(Java Doc) public boolean isKindOf(RubyModule type)(Code)(Java Doc) public boolean isNil()(Code)(Java Doc) public boolean isSingleton()(Code)(Java Doc) public boolean isTaint()(Code)(Java Doc) final public boolean isTrue()(Code)(Java Doc) public RubyBoolean kind_of(IRubyObject type)(Code)(Java Doc) public RubyClass makeMetaClass(RubyClass superClass, SinglyLinkedList parentCRef)(Code)(Java Doc) public IRubyObject match(IRubyObject arg)(Code)(Java Doc) public IRubyObject method(IRubyObject symbol)(Code)(Java Doc) public IRubyObject methods(IRubyObject[] args)(Code)(Java Doc) public IRubyObject nil_p()(Code)(Java Doc) public IRubyObject obj_equal(IRubyObject obj)(Code)(Java Doc) public IRubyObject private_methods(IRubyObject[] args)(Code)(Java Doc) public IRubyObject protected_methods(IRubyObject[] args)(Code)(Java Doc) public IRubyObject public_methods(IRubyObject[] args)(Code)(Java Doc) public static void puts(Object obj)(Code)(Java Doc) public IRubyObject rbClone(Block unusedBlock)(Code)(Java Doc) public void removeFinalizers()(Code)(Java Doc) public IRubyObject removeInstanceVariable(String name)(Code)(Java Doc) public IRubyObject remove_instance_variable(IRubyObject name, Block block)(Code)(Java Doc) public RubyBoolean respond_to(IRubyObject[] args)(Code)(Java Doc) public boolean respondsTo(String name)(Code)(Java Doc) public Map safeGetInstanceVariables()(Code)(Java Doc) public boolean safeHasInstanceVariables()(Code)(Java Doc) public IRubyObject send(IRubyObject[] args, Block block)(Code)(Java Doc) public void setFrozen(boolean frozen)(Code)(Java Doc) public IRubyObject setInstanceVariable(String name, IRubyObject value, String taintError, String freezeError)(Code)(Java Doc) public IRubyObject setInstanceVariable(String name, IRubyObject value)(Code)(Java Doc) public void setInstanceVariables(Map instanceVariables)(Code)(Java Doc) public void setMetaClass(RubyClass metaClass)(Code)(Java Doc) public void setTaint(boolean taint)(Code)(Java Doc) public RubyArray singleton_methods(IRubyObject[] args)(Code)(Java Doc) public IRubyObject specificEval(RubyModule mod, IRubyObject[] args, Block block)(Code)(Java Doc) public IRubyObject taint()(Code)(Java Doc) public RubyBoolean tainted()(Code)(Java Doc) protected void testFrozen(String message)(Code)(Java Doc) public String toString()(Code)(Java Doc) public IRubyObject to_s()(Code)(Java Doc) public static String trueFalseNil(IRubyObject v)(Code)(Java Doc) public static String trueFalseNil(String v)(Code)(Java Doc) public RubyClass type()(Code)(Java Doc) public RubyClass type_deprecated()(Code)(Java Doc) public IRubyObject untaint()(Code)(Java Doc)
|
|
|