public class RubyThread extends RubyObject implements ExecutionContext
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.
Modifier and Type | Class and Description |
---|---|
static interface |
RubyThread.BlockingTask
Deprecated.
|
static class |
RubyThread.Location |
static class |
RubyThread.SleepTask |
static class |
RubyThread.Status
Thread statuses
|
static interface |
RubyThread.Task<Data,Return> |
static interface |
RubyThread.Unblocker<Data> |
RubyObject.Data
RubyBasicObject.Finalizer
Modifier and Type | Field and Description |
---|---|
static int |
RUBY_MAX_THREAD_PRIORITY |
static int |
RUBY_MIN_THREAD_PRIORITY |
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUST_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStamp
Modifier | Constructor and Description |
---|---|
protected |
RubyThread(Ruby runtime,
RubyClass type) |
|
RubyThread(Ruby runtime,
RubyClass klass,
java.lang.Runnable runnable) |
Modifier and Type | Method and Description |
---|---|
static IRubyObject |
abort_on_exception_set_x(IRubyObject recv,
IRubyObject value) |
IRubyObject |
abort_on_exception_set(IRubyObject val) |
static RubyBoolean |
abort_on_exception_x(IRubyObject recv)
Returns the status of the global ``abort on exception'' condition.
|
RubyBoolean |
abort_on_exception() |
static RubyThread |
adopt(IRubyObject recv,
java.lang.Thread t) |
static RubyThread |
adopt(Ruby runtime,
ThreadService service,
java.lang.Thread thread) |
void |
afterBlockingCall() |
RubyBoolean |
alive_p() |
IRubyObject |
backtrace_locations(ThreadContext context) |
IRubyObject |
backtrace_locations(ThreadContext context,
IRubyObject level) |
IRubyObject |
backtrace_locations(ThreadContext context,
IRubyObject[] args)
Deprecated.
|
IRubyObject |
backtrace_locations(ThreadContext context,
IRubyObject level,
IRubyObject length) |
IRubyObject |
backtrace(ThreadContext context) |
IRubyObject |
backtrace(ThreadContext context,
IRubyObject level) |
IRubyObject |
backtrace(ThreadContext context,
IRubyObject[] args)
Deprecated.
|
IRubyObject |
backtrace(ThreadContext context,
IRubyObject level,
IRubyObject length) |
IRubyObject |
backtrace20(ThreadContext context,
IRubyObject[] args)
Deprecated.
|
void |
beDead() |
void |
beforeBlockingCall() |
void |
beforeStart()
Perform pre-execution tasks once the native thread is running, but we
have not yet called the Ruby code for the thread.
|
void |
checkMail(ThreadContext context)
Deprecated.
|
void |
cleanTerminate(IRubyObject result) |
void |
clearContext() |
static RubyClass |
createThreadClass(Ruby runtime) |
static RubyThread |
current(IRubyObject recv) |
void |
dieFromFinalizer()
Used for finalizers that need to kill a Ruby thread.
|
void |
dispose()
Dispose of the current thread by tidying up connections to other stuff
|
void |
enterSleep() |
boolean |
equals(java.lang.Object obj)
This override does not do a "checked" dispatch.
|
void |
exceptionRaised(RaiseException exception) |
void |
exceptionRaised(java.lang.Throwable throwable)
For handling all exceptions bubbling out of threads
|
static IRubyObject |
exclusive(ThreadContext context,
IRubyObject recv,
Block block)
Deprecated.
|
void |
executeBlockingTask(RubyThread.BlockingTask task)
Deprecated.
|
<Data,Return> |
executeTask(ThreadContext context,
Data data,
RubyThread.Task<Data,Return> task) |
static IRubyObject |
exit(IRubyObject receiver,
Block block) |
void |
exitSleep() |
IRubyObject |
fetch(ThreadContext context,
IRubyObject key,
Block block) |
IRubyObject |
fetch(ThreadContext context,
IRubyObject key,
IRubyObject _default,
Block block) |
ThreadContext |
getContext() |
java.util.Map<java.lang.Object,IRubyObject> |
getContextVariables() |
IRubyObject |
getErrorInfo() |
RubyThread |
getFiberCurrentThread() |
IRubyObject |
getName() |
java.lang.Thread |
getNativeThread() |
RubyThreadGroup |
getThreadGroup() |
IRubyObject |
group() |
static IRubyObject |
handle_interrupt(ThreadContext context,
IRubyObject self,
IRubyObject _mask,
Block block) |
int |
hashCode()
This override does not do "checked" dispatch since Object usually has #hash defined.
|
IRubyObject |
initialize(ThreadContext context,
IRubyObject[] args,
Block block) |
IRubyObject |
inspect()
rb_obj_inspect
call-seq:
obj.inspect => string
Returns a string containing a human-readable representation of
obj.
|
RubyString |
inspect(ThreadContext context) |
void |
internalRaise(IRubyObject[] args)
Deprecated.
|
void |
interrupt() |
boolean |
isAlive() |
java.lang.StackTraceElement[] |
javaBacktrace() |
static int |
javaPriorityToRubyPriority(int javaPriority) |
IRubyObject |
join(IRubyObject[] args)
Deprecated.
|
IRubyObject |
join(ThreadContext context,
IRubyObject[] args) |
RubyBoolean |
key_p(IRubyObject key)
Deprecated.
|
RubyBoolean |
key_p(ThreadContext context,
IRubyObject key) |
RubyArray |
keys() |
IRubyObject |
kill() |
static IRubyObject |
kill(IRubyObject receiver,
IRubyObject rubyThread,
Block block) |
static RubyArray |
list(IRubyObject recv) |
void |
lock(java.util.concurrent.locks.Lock lock)
Acquire the given lock, holding a reference to it for cleanup on thread
termination.
|
void |
lockInterruptibly(java.util.concurrent.locks.Lock lock)
Acquire the given lock interruptibly, holding a reference to it for cleanup
on thread termination.
|
static RubyThread |
main(IRubyObject recv) |
static RubyThread |
mainThread(IRubyObject receiver) |
static IRubyObject |
newInstance(IRubyObject recv,
IRubyObject[] args,
Block block)
Thread.new |
IRubyObject |
op_aref(IRubyObject key)
Deprecated.
|
IRubyObject |
op_aref(ThreadContext context,
IRubyObject key) |
IRubyObject |
op_aset(IRubyObject key,
IRubyObject value) |
static IRubyObject |
pass(IRubyObject recv)
Deprecated.
|
static IRubyObject |
pass(ThreadContext context,
IRubyObject recv) |
IRubyObject |
pending_interrupt_p(ThreadContext context,
IRubyObject[] args) |
static IRubyObject |
pending_interrupt_p(ThreadContext context,
IRubyObject self,
IRubyObject[] args) |
void |
pollThreadEvents() |
void |
pollThreadEvents(ThreadContext context) |
protected void |
printReportExceptionWarning() |
IRubyObject |
priority_set(IRubyObject priority) |
RubyFixnum |
priority() |
IRubyObject |
raise(IRubyObject exception)
Simplified utility method for just raising an existing exception in this
thread.
|
IRubyObject |
raise(IRubyObject[] args,
Block block)
Deprecated.
|
IRubyObject |
raise(IRubyObject exception,
RubyString message)
Simplified utility method for just raising an existing exception in this
thread.
|
IRubyObject |
raise(ThreadContext context,
IRubyObject[] args,
Block block) |
void |
receiveMail(ThreadService.Event event)
Deprecated.
|
IRubyObject |
report_on_exception_set(ThreadContext context,
IRubyObject state) |
static IRubyObject |
report_on_exception_set(ThreadContext context,
IRubyObject self,
IRubyObject state) |
IRubyObject |
report_on_exception(ThreadContext context) |
static IRubyObject |
report_on_exception(ThreadContext context,
IRubyObject self) |
static int |
rubyPriorityToJavaPriority(int rubyPriority) |
IRubyObject |
run() |
IRubyObject |
safe_level() |
boolean |
select(java.nio.channels.Channel channel,
OpenFile fptr,
int ops)
Perform an interruptible select operation on the given channel and fptr,
waiting for the requested operations.
|
boolean |
select(java.nio.channels.Channel channel,
OpenFile fptr,
int ops,
long timeout)
Perform an interruptible select operation on the given channel and fptr,
waiting for the requested operations or the given timeout.
|
boolean |
select(java.nio.channels.Channel channel,
RubyIO io,
int ops)
Perform an interruptible select operation on the given channel and fptr,
waiting for the requested operations.
|
boolean |
select(java.nio.channels.Channel channel,
RubyIO io,
int ops,
long timeout)
Perform an interruptible select operation on the given channel and fptr,
waiting for the requested operations or the given timeout.
|
boolean |
select(RubyIO io,
int ops)
Perform an interruptible select operation on the given channel and fptr,
waiting for the requested operations or the given timeout.
|
boolean |
select(RubyIO io,
int ops,
long timeout)
Perform an interruptible select operation on the given channel and fptr,
waiting for the requested operations or the given timeout.
|
boolean |
selectForAccept(RubyIO io)
Deprecated.
|
void |
setContext(ThreadContext context) |
IRubyObject |
setErrorInfo(IRubyObject errorInfo) |
void |
setFiberCurrentThread(RubyThread fiberCurrentThread) |
void |
setInterrupt() |
IRubyObject |
setName(IRubyObject name) |
void |
sleep(java.util.concurrent.locks.Lock lock)
Release lock and sleep.
|
void |
sleep(java.util.concurrent.locks.Lock lock,
long millis)
Release lock and sleep for the specified number of milliseconds.
|
boolean |
sleep(long millis)
Sleep the current thread for millis, waking up on any thread interrupts.
|
static RubyThread |
start(IRubyObject recv,
IRubyObject[] args,
Block block)
Basically the same as Thread.new .
|
static RubyThread |
start19(IRubyObject recv,
IRubyObject[] args,
Block block)
Deprecated.
|
protected static RubyThread |
startWaiterThread(Ruby runtime,
int pid,
Block block) |
IRubyObject |
status() |
IRubyObject |
status(ThreadContext context) |
RubyBoolean |
stop_p() |
static IRubyObject |
stop(ThreadContext context,
IRubyObject receiver) |
IRubyObject |
thread_variable_get(ThreadContext context,
IRubyObject key) |
IRubyObject |
thread_variable_p(ThreadContext context,
IRubyObject key) |
IRubyObject |
thread_variable_set(ThreadContext context,
IRubyObject key,
IRubyObject value) |
IRubyObject |
thread_variables(ThreadContext context) |
java.lang.String |
toString()
The default toString method is just a wrapper that calls the
Ruby "to_s" method.
|
boolean |
tryLock(java.util.concurrent.locks.Lock lock)
Try to acquire the given lock, adding it to a list of held locks for cleanup
on thread termination if it is acquired.
|
void |
unlock(java.util.concurrent.locks.Lock lock)
Release the given lock and remove it from the list of locks to be released
on thread termination.
|
void |
unlockAll()
Release all locks held.
|
IRubyObject |
value()
Deprecated.
|
IRubyObject |
value(ThreadContext context) |
boolean |
wait_timeout(IRubyObject o,
java.lang.Double timeout) |
boolean |
waitForIO(ThreadContext context,
RubyIO io,
int ops) |
RubyThread |
wakeup() |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, eqlInternal, equalInternal, getNativeClassIndex, inspect, op_eqq, puts, specificEval, toRubyString
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dup, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id, infectBy, initialize_copy, initialize, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing, method_missing19, method, method19, methods, methods, methods19, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_equal_19, op_equal, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_method, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_s, toJava, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
array
public static final int RUBY_MIN_THREAD_PRIORITY
public static final int RUBY_MAX_THREAD_PRIORITY
public IRubyObject getErrorInfo()
public IRubyObject setErrorInfo(IRubyObject errorInfo)
public void setContext(ThreadContext context)
public void clearContext()
public ThreadContext getContext()
public java.lang.Thread getNativeThread()
public void setFiberCurrentThread(RubyThread fiberCurrentThread)
public RubyThread getFiberCurrentThread()
public void beforeStart()
public void dispose()
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. 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 RubyThread start(IRubyObject recv, IRubyObject[] args, Block block)
@Deprecated public static RubyThread start19(IRubyObject recv, IRubyObject[] args, Block block)
public static RubyThread adopt(IRubyObject recv, java.lang.Thread t)
public static RubyThread adopt(Ruby runtime, ThreadService service, java.lang.Thread thread)
public IRubyObject initialize(ThreadContext context, IRubyObject[] args, Block block)
protected static RubyThread startWaiterThread(Ruby runtime, int pid, Block block)
public void cleanTerminate(IRubyObject result)
public void beDead()
public void pollThreadEvents()
public void pollThreadEvents(ThreadContext context)
public static IRubyObject handle_interrupt(ThreadContext context, IRubyObject self, IRubyObject _mask, Block block)
public static IRubyObject pending_interrupt_p(ThreadContext context, IRubyObject self, IRubyObject[] args)
public IRubyObject pending_interrupt_p(ThreadContext context, IRubyObject[] args)
public IRubyObject setName(IRubyObject name)
public IRubyObject getName()
public static RubyBoolean abort_on_exception_x(IRubyObject recv)
public static IRubyObject abort_on_exception_set_x(IRubyObject recv, IRubyObject value)
public static RubyThread current(IRubyObject recv)
public static RubyThread main(IRubyObject recv)
public static IRubyObject pass(ThreadContext context, IRubyObject recv)
public static RubyArray list(IRubyObject recv)
public final java.util.Map<java.lang.Object,IRubyObject> getContextVariables()
getContextVariables
in interface ExecutionContext
public boolean isAlive()
public IRubyObject fetch(ThreadContext context, IRubyObject key, Block block)
public IRubyObject fetch(ThreadContext context, IRubyObject key, IRubyObject _default, Block block)
public IRubyObject op_aref(ThreadContext context, IRubyObject key)
@Deprecated public IRubyObject op_aref(IRubyObject key)
public IRubyObject op_aset(IRubyObject key, IRubyObject value)
public RubyBoolean key_p(ThreadContext context, IRubyObject key)
@Deprecated public RubyBoolean key_p(IRubyObject key)
public RubyArray keys()
public IRubyObject thread_variable_p(ThreadContext context, IRubyObject key)
public IRubyObject thread_variable_get(ThreadContext context, IRubyObject key)
public IRubyObject thread_variable_set(ThreadContext context, IRubyObject key, IRubyObject value)
public IRubyObject thread_variables(ThreadContext context)
public RubyBoolean abort_on_exception()
public IRubyObject abort_on_exception_set(IRubyObject val)
public RubyBoolean alive_p()
@Deprecated public IRubyObject join(IRubyObject[] args)
public IRubyObject join(ThreadContext context, IRubyObject[] args)
public IRubyObject value(ThreadContext context)
@Deprecated public IRubyObject value()
public IRubyObject group()
public IRubyObject inspect()
RubyBasicObject
to_s
method to
generate the string.
[ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]"
Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"inspect
in interface IRubyObject
inspect
in class RubyBasicObject
public RubyString inspect(ThreadContext context)
public static IRubyObject stop(ThreadContext context, IRubyObject receiver)
public static IRubyObject kill(IRubyObject receiver, IRubyObject rubyThread, Block block)
public static IRubyObject exit(IRubyObject receiver, Block block)
public RubyBoolean stop_p()
public RubyThread wakeup()
public RubyFixnum priority()
public IRubyObject priority_set(IRubyObject priority)
public static int javaPriorityToRubyPriority(int javaPriority)
public static int rubyPriorityToJavaPriority(int rubyPriority)
public final IRubyObject raise(IRubyObject exception)
exception
- the exception to raisepublic final IRubyObject raise(IRubyObject exception, RubyString message)
exception
- the exception to raisemessage
- the message to usepublic IRubyObject raise(ThreadContext context, IRubyObject[] args, Block block)
@Deprecated public IRubyObject raise(IRubyObject[] args, Block block)
public IRubyObject run()
public boolean sleep(long millis) throws java.lang.InterruptedException
millis
- Number of milliseconds to sleep. Zero sleeps forever.java.lang.InterruptedException
public IRubyObject status()
public IRubyObject status(ThreadContext context)
@Deprecated public void executeBlockingTask(RubyThread.BlockingTask task) throws java.lang.InterruptedException
java.lang.InterruptedException
public <Data,Return> Return executeTask(ThreadContext context, Data data, RubyThread.Task<Data,Return> task) throws java.lang.InterruptedException
java.lang.InterruptedException
public void enterSleep()
public void exitSleep()
public IRubyObject kill()
public void dieFromFinalizer()
public IRubyObject safe_level()
public IRubyObject backtrace(ThreadContext context)
public IRubyObject backtrace(ThreadContext context, IRubyObject level)
public IRubyObject backtrace(ThreadContext context, IRubyObject level, IRubyObject length)
public IRubyObject backtrace_locations(ThreadContext context)
public IRubyObject backtrace_locations(ThreadContext context, IRubyObject level)
public IRubyObject backtrace_locations(ThreadContext context, IRubyObject level, IRubyObject length)
public IRubyObject report_on_exception_set(ThreadContext context, IRubyObject state)
public IRubyObject report_on_exception(ThreadContext context)
public static IRubyObject report_on_exception_set(ThreadContext context, IRubyObject self, IRubyObject state)
public static IRubyObject report_on_exception(ThreadContext context, IRubyObject self)
public java.lang.StackTraceElement[] javaBacktrace()
public void exceptionRaised(RaiseException exception)
protected void printReportExceptionWarning()
public void exceptionRaised(java.lang.Throwable throwable)
throwable
- public static RubyThread mainThread(IRubyObject receiver)
public boolean select(RubyIO io, int ops)
io
- the RubyIO that contains the channel, for managing blocked threads list.ops
- the operations to wait for, from SelectionKey
.public boolean select(RubyIO io, int ops, long timeout)
io
- the RubyIO that contains the channel, for managing blocked threads list.ops
- the operations to wait for, from SelectionKey
.timeout
- a timeout in ms to limit the select. Less than zero selects forever,
zero selects and returns ready channels or nothing immediately, and
greater than zero selects for at most that many ms.public boolean select(java.nio.channels.Channel channel, OpenFile fptr, int ops)
channel
- the channel to perform a select against. If this is not
a selectable channel, then this method will just return true.fptr
- the fptr that contains the channel, for managing blocked threads list.ops
- the operations to wait for, from SelectionKey
.public boolean select(java.nio.channels.Channel channel, RubyIO io, int ops)
channel
- the channel to perform a select against. If this is not
a selectable channel, then this method will just return true.io
- the RubyIO that contains the channel, for managing blocked threads list.ops
- the operations to wait for, from SelectionKey
.public boolean select(java.nio.channels.Channel channel, RubyIO io, int ops, long timeout)
channel
- the channel to perform a select against. If this is not
a selectable channel, then this method will just return true.io
- the RubyIO that contains the channel, for managing blocked threads list.ops
- the operations to wait for, from SelectionKey
.timeout
- a timeout in ms to limit the select. Less than zero selects forever,
zero selects and returns ready channels or nothing immediately, and
greater than zero selects for at most that many ms.public boolean select(java.nio.channels.Channel channel, OpenFile fptr, int ops, long timeout)
channel
- the channel to perform a select against. If this is not
a selectable channel, then this method will just return true.fptr
- the fptr that contains the channel, for managing blocked threads list.ops
- the operations to wait for, from SelectionKey
.timeout
- a timeout in ms to limit the select. Less than zero selects forever,
zero selects and returns ready channels or nothing immediately, and
greater than zero selects for at most that many ms.public void interrupt()
public void setInterrupt()
public boolean waitForIO(ThreadContext context, RubyIO io, int ops)
public void beforeBlockingCall()
public void afterBlockingCall()
public boolean wait_timeout(IRubyObject o, java.lang.Double timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public RubyThreadGroup getThreadGroup()
public boolean equals(java.lang.Object obj)
RubyObject
equals
in class RubyObject
RubyBasicObject.equals(Object)
public int hashCode()
RubyObject
hashCode
in class RubyObject
RubyBasicObject.hashCode()
public java.lang.String toString()
RubyObject
toString
in class RubyObject
public void lock(java.util.concurrent.locks.Lock lock)
lock
- the lock to acquire, released on thread terminationpublic void lockInterruptibly(java.util.concurrent.locks.Lock lock) throws java.lang.InterruptedException
lock
- the lock to acquire, released on thread terminationjava.lang.InterruptedException
- if the lock acquisition is interruptedpublic boolean tryLock(java.util.concurrent.locks.Lock lock)
lock
- the lock to acquire, released on thread terminationpublic void unlock(java.util.concurrent.locks.Lock lock)
lock
- the lock to release and dereferencespublic void unlockAll()
public void sleep(java.util.concurrent.locks.Lock lock) throws java.lang.InterruptedException
java.lang.InterruptedException
public void sleep(java.util.concurrent.locks.Lock lock, long millis) throws java.lang.InterruptedException
java.lang.InterruptedException
@Deprecated public static IRubyObject exclusive(ThreadContext context, IRubyObject recv, Block block)
@Deprecated public void internalRaise(IRubyObject[] args)
args
- Same args as for Thread#raise@Deprecated public void receiveMail(ThreadService.Event event)
@Deprecated public void checkMail(ThreadContext context)
@Deprecated public boolean selectForAccept(RubyIO io)
@Deprecated public IRubyObject backtrace20(ThreadContext context, IRubyObject[] args)
@Deprecated public IRubyObject backtrace(ThreadContext context, IRubyObject[] args)
@Deprecated public IRubyObject backtrace_locations(ThreadContext context, IRubyObject[] args)
@Deprecated public static IRubyObject pass(IRubyObject recv)
Copyright © 2001-2019 JRuby. All Rights Reserved.