Logo Search packages:      
Sourcecode: jruby version File versions  Download package

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Package Functions | Static Package Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

org::jruby::RubyThread Class Reference

Inheritance diagram for org::jruby::RubyThread:
Inheritance graph
Collaboration diagram for org::jruby::RubyThread:
Collaboration graph

List of all members.

Public Types

enum  Status { RUN, SLEEP, ABORTING, DEAD }

Public Member Functions

RubyBoolean abort_on_exception ()
IRubyObject abort_on_exception_set (IRubyObject val)
void addFinalizer (IRubyObject f)
void afterBlockingCall ()
RubyBoolean alive_p ()
IRubyObject anyToString ()
String asJavaString ()
RubyString asString ()
void attachToObjectSpace ()
IRubyObject backtrace (ThreadContext context)
synchronized void beDead ()
void beforeBlockingCall ()
final void callInit (IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, String name)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject arg)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args)
final IRubyObject callMethod (String name, IRubyObject...args)
final IRubyObject callMethod (String name)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name, IRubyObject arg)
IRubyObject callSuper (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject checkArrayType ()
final IRubyObject checkCallMethod (ThreadContext context, String name)
synchronized void checkMail (ThreadContext context)
IRubyObject checkStringType ()
IRubyObject checkStringType19 ()
synchronized void cleanTerminate (IRubyObject result)
int compareTo (IRubyObject other)
RubyArray convertToArray ()
RubyFloat convertToFloat ()
RubyHash convertToHash ()
RubyInteger convertToInteger ()
RubyInteger convertToInteger (int methodIndex, String convertMethod)
RubyInteger convertToInteger (String convertMethod)
RubyString convertToString ()
final IRubyObject convertToType (RubyClass target, int convertMethodIndex)
void copyInstanceVariablesInto (final InstanceVariables other)
void copyInstanceVariablesInto (InstanceVariables other)
void copySpecialInstanceVariables (IRubyObject clone)
synchronized Object dataGetStruct ()
synchronized Object dataGetStructChecked ()
synchronized void dataWrapStruct (Object obj)
IRubyObject display (ThreadContext context, IRubyObject[] args)
void dispose ()
IRubyObject dup ()
void enterSleep ()
boolean eql (IRubyObject other)
IRubyObject eql_p (IRubyObject obj)
IRubyObject equal_p (ThreadContext context, IRubyObject obj)
IRubyObject equal_p19 (ThreadContext context, IRubyObject other)
boolean equals (Object obj)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, RubyString src, String file, int line)
void exceptionRaised (RaiseException exception)
void exitSleep ()
IRubyObject extend (IRubyObject[] args)
IRubyObject fastGetInstanceVariable (String internedName)
Object fastGetInternalVariable (String internedName)
boolean fastHasInstanceVariable (String internedName)
boolean fastHasInternalVariable (String internedName)
IRubyObject fastSetInstanceVariable (String internedName, IRubyObject value)
void fastSetInternalVariable (String internedName, Object value)
IRubyObject freeze (ThreadContext context)
RubyBoolean frozen_p (ThreadContext context)
ThreadContext getContext ()
final Map< Object, IRubyObjectgetContextVariables ()
IRubyObject getErrorInfo ()
final boolean getFlag (int flag)
IRubyObject getInstanceVariable (String name)
List< Variable< IRubyObject > > getInstanceVariableList ()
List< String > getInstanceVariableNameList ()
InstanceVariables getInstanceVariables ()
Object getInternalVariable (String name)
InternalVariables getInternalVariables ()
Class getJavaClass ()
final RubyClass getMetaClass ()
int getNativeTypeIndex ()
final Ruby getRuntime ()
RubyClass getSingletonClass ()
RubyClass getType ()
Object getVariable (int index)
int getVariableCount ()
List< Variable< Object > > getVariableList ()
List< String > getVariableNameList ()
IRubyObject group ()
RubyFixnum hash ()
int hashCode ()
IRubyObject hashyInspect ()
boolean hasInstanceVariable (String name)
boolean hasInternalVariable (String name)
boolean hasVariables ()
IRubyObject id ()
IRubyObject id_deprecated ()
IRubyObject infectBy (IRubyObject obj)
IRubyObject initialize (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject initialize ()
IRubyObject initialize_copy (IRubyObject original)
synchronized IRubyObject inspect ()
IRubyObject instance_eval (ThreadContext context, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject instance_exec (ThreadContext context, IRubyObject[] args, Block block)
RubyBoolean instance_of_p (ThreadContext context, IRubyObject type)
IRubyObject instance_variable_defined_p (ThreadContext context, IRubyObject name)
IRubyObject instance_variable_get (ThreadContext context, IRubyObject name)
IRubyObject instance_variable_set (IRubyObject name, IRubyObject value)
RubyArray instance_variables (ThreadContext context)
void internalRaise (IRubyObject[] args)
void interrupt ()
boolean isAlive ()
boolean isBuiltin (String methodName)
boolean isClass ()
final boolean isFalse ()
boolean isFrozen ()
boolean isImmediate ()
boolean isModule ()
final boolean isNil ()
boolean isTaint ()
final boolean isTrue ()
boolean isUntrusted ()
IRubyObject join (IRubyObject[] args)
RubyBoolean key_p (IRubyObject key)
RubyArray keys ()
IRubyObject kill ()
IRubyObject kill_bang ()
RubyBoolean kind_of_p (ThreadContext context, IRubyObject type)
RubyClass makeMetaClass (RubyClass superClass)
IRubyObject method (IRubyObject symbol)
IRubyObject methods (ThreadContext context, IRubyObject[] args)
IRubyObject methods (ThreadContext context, IRubyObject[] args, boolean useSymbols)
IRubyObject methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject nil_p (ThreadContext context)
IRubyObject op_aref (IRubyObject key)
IRubyObject op_aset (IRubyObject key, IRubyObject value)
IRubyObject op_eqq (ThreadContext context, IRubyObject other)
IRubyObject op_equal (ThreadContext context, IRubyObject obj)
IRubyObject op_equal_19 (ThreadContext context, IRubyObject obj)
IRubyObject op_match (ThreadContext context, IRubyObject arg)
IRubyObject op_not (ThreadContext context)
IRubyObject op_not_equal (ThreadContext context, IRubyObject other)
IRubyObject op_not_match (ThreadContext context, IRubyObject arg)
void pollThreadEvents (ThreadContext context)
void pollThreadEvents ()
RubyFixnum priority ()
IRubyObject priority_set (IRubyObject priority)
IRubyObject private_methods (ThreadContext context, IRubyObject[] args)
IRubyObject private_methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject protected_methods (ThreadContext context, IRubyObject[] args)
IRubyObject protected_methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject public_methods (ThreadContext context, IRubyObject[] args)
IRubyObject public_methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject raise (IRubyObject[] args, Block block)
IRubyObject rbClone ()
void receiveMail (ThreadService.Event event)
IRubyObject remove_instance_variable (ThreadContext context, IRubyObject name, Block block)
void removeFinalizers ()
IRubyObject removeInstanceVariable (String name)
Object removeInternalVariable (String name)
RubyBoolean respond_to_p (IRubyObject mname)
RubyBoolean respond_to_p (IRubyObject mname, IRubyObject includePrivate)
final boolean respondsTo (String name)
synchronized IRubyObject run ()
IRubyObject safe_level ()
boolean select (RubyIO io, int ops)
boolean select (Channel channel, RubyIO io, int ops)
boolean selectForAccept (RubyIO io)
IRubyObject send (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject send (ThreadContext context, Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject send (ThreadContext context, IRubyObject[] args, Block block)
void setContext (ThreadContext context)
IRubyObject setErrorInfo (IRubyObject errorInfo)
final void setFlag (int flag, boolean set)
void setFrozen (boolean frozen)
IRubyObject setInstanceVariable (String name, IRubyObject value)
void setInternalVariable (String name, Object value)
void setMetaClass (RubyClass metaClass)
void setTaint (boolean taint)
void setUntrusted (boolean untrusted)
synchronized void setVariable (int index, Object value)
RubyArray singleton_methods (ThreadContext context, IRubyObject[] args)
RubyArray singleton_methods19 (ThreadContext context, IRubyObject[] args)
RubyArray singletonMethods (ThreadContext context, IRubyObject[] args, boolean asSymbols)
synchronized boolean sleep (long millis) throws InterruptedException
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject[] args, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
synchronized IRubyObject status ()
RubyBoolean stop_p ()
void syncVariables (List< Variable< Object >> variables)
IRubyObject taint (ThreadContext context)
RubyBoolean tainted_p (ThreadContext context)
RubyArray to_a ()
IRubyObject to_s ()
Object toJava (Class target)
String toString ()
IRubyObject trust (ThreadContext context)
RubyClass type ()
RubyClass type_deprecated ()
IRubyObject untaint (ThreadContext context)
IRubyObject untrust (ThreadContext context)
RubyBoolean untrusted_p (ThreadContext context)
IRubyObject value ()
boolean wait_timeout (IRubyObject o, Double timeout) throws InterruptedException
boolean waitForIO (ThreadContext context, RubyIO io, int ops)
synchronized RubyThread wakeup ()

Static Public Member Functions

static IRubyObject abort_on_exception_set_x (IRubyObject recv, IRubyObject value)
static RubyBoolean abort_on_exception_x (IRubyObject recv)
static RubyThread adopt (IRubyObject recv, Thread t)
static RubyClass createBasicObjectClass (Ruby runtime, RubyClass objectClass)
static RubyClass createObjectClass (Ruby runtime, RubyClass objectClass)
static RubyClass createThreadClass (Ruby runtime)
static IRubyObject critical (IRubyObject receiver)
static IRubyObject critical_set (IRubyObject receiver, IRubyObject value)
static RubyThread current (IRubyObject recv)
static IRubyObject kill (IRubyObject receiver, IRubyObject rubyThread, Block block)
static RubyArray list (IRubyObject recv)
static RubyThread main (IRubyObject recv)
static RubyThread mainThread (IRubyObject receiver)
static IRubyObject newInstance (IRubyObject recv, IRubyObject[] args, Block block)
static IRubyObject pass (IRubyObject recv)
static void puts (Object obj)
static IRubyObject s_exit (IRubyObject receiver, Block block)
static RubyThread start (IRubyObject recv, IRubyObject[] args, Block block)
static IRubyObject stop (ThreadContext context, IRubyObject receiver)

Static Public Attributes

static final int ALL_F = -1
static final int COMPARE_BY_IDENTITY_F = (1<<(FL_USHIFT+8))
static final int FALSE_F = 1 << 0
static final int FL_USHIFT = 5
static final int FROZEN_F = 1 << 2
static final IRubyObject NEVER = new RubyBasicObject()
static final int NIL_F = 1 << 1
static final IRubyObject[] NULL_ARRAY = new IRubyObject[0]
static final ObjectAllocator OBJECT_ALLOCATOR
static final int TAINTED_F = 1 << 3
static final IRubyObject UNDEF = new RubyBasicObject()
static final int UNTRUSTED_F = 1 << 4
static final int USER0_F = (1<<(FL_USHIFT+0))
static final int USER1_F = (1<<(FL_USHIFT+1))
static final int USER2_F = (1<<(FL_USHIFT+2))
static final int USER3_F = (1<<(FL_USHIFT+3))
static final int USER4_F = (1<<(FL_USHIFT+4))
static final int USER5_F = (1<<(FL_USHIFT+5))
static final int USER6_F = (1<<(FL_USHIFT+6))
static final int USER7_F = (1<<(FL_USHIFT+7))

Protected Member Functions

void checkFrozen ()
final void ensureInstanceVariablesSettable ()
synchronized long getObjectId ()
RubyClass getSingletonClassClone ()
synchronized long initObjectId (RubyClass.VariableAccessor objectIdAccessor)
int inspectHashCode ()
 RubyThread (Ruby runtime, RubyClass type)
void taint (Ruby runtime)
final void testFrozen (String message)
final void testFrozen ()
String validateInstanceVariable (String name)
boolean variableTableContains (String name)
boolean variableTableFastContains (String internedName)
Object variableTableFastFetch (String internedName)
Object variableTableFastStore (String internedName, Object value)
Object variableTableFetch (String name)
Object variableTableRemove (String name)
Object variableTableStore (String name, Object value)
void variableTableSync (List< Variable< Object >> vars)

Static Protected Member Functions

static boolean eqlInternal (final ThreadContext context, final IRubyObject that, final IRubyObject other)
static boolean equalInternal (final ThreadContext context, final IRubyObject that, final IRubyObject other)

Protected Attributes

int flags
transient RubyClass metaClass

Static Protected Attributes

static final String ERR_INSECURE_SET_INST_VAR = "Insecure: can't modify instance variable"

Package Functions

IRubyObject checkIntegerType (Ruby runtime, IRubyObject obj, String method)
final RubyBasicObject infectBy (RubyBasicObject obj)
final RubyBasicObject infectBy (int tuFlags)
void setThreadGroup (RubyThreadGroup rubyThreadGroup)

Static Package Functions

static RubyString inspect (ThreadContext context, IRubyObject object)

Private Member Functions

boolean abortOnException (Ruby runtime)
void addToCorrectThreadGroup (ThreadContext context)
synchronized Selector getSelector (SelectableChannel channel) throws IOException
IRubyObject getSymbolKey (IRubyObject originalKey)
synchronized Map< IRubyObject,
getThreadLocals ()
boolean isCurrent ()
IRubyObject prepareRaiseException (Ruby runtime, IRubyObject[] args, Block block)
void receivedAnException (ThreadContext context, IRubyObject exception)

Static Private Member Functions

static RubyThread adoptThread (final IRubyObject recv, Thread t, Block block)
static RubyThread startThread (final IRubyObject recv, final IRubyObject[] args, boolean callInit, Block block)
static void throwThreadKill ()

Private Attributes

boolean abortOnException
volatile BlockingIO.Condition blockingIO = null
volatile WeakReference
< ThreadContext
final Map< Object, IRubyObjectcontextVariables = new WeakHashMap<Object, IRubyObject>()
volatile Selector currentSelector
volatile Object currentWaitObject
IRubyObject errorInfo
RaiseException exitingException
IRubyObject finalResult
volatile ThreadService.Event mail
RubyFixnum priority
volatile Status status = Status.RUN
RubyThreadGroup threadGroup
ThreadLike threadImpl
transient Map< IRubyObject,
final ThreadService threadService

Static Private Attributes

static final boolean DEBUG = false

Detailed Description

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.

Definition at line 82 of file RubyThread.java.

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index