public class FutureThread extends Object implements ThreadLike
| Modifier and Type | Field and Description |
|---|---|
RubyThread |
rubyThread |
| Constructor and Description |
|---|
FutureThread(RubyThread rubyThread,
ThreadedRunnable runnable) |
| Modifier and Type | Method and Description |
|---|---|
Future |
getFuture() |
int |
getPriority()
The current priority of the thread associated with this future.
|
void |
interrupt()
In order to do a thread interrupt, we need to get the actual thread, stored
in the RubyRunnable instance and tell it to interrupt.
|
boolean |
isAlive()
If the future has not yet run and or is running and not yet complete.
|
boolean |
isCurrent() |
boolean |
isInterrupted() |
void |
join() |
void |
join(long millis)
We check for zero millis here because Future appears to wait for zero if
you pass it zero, where Thread behavior is to wait forever.
|
Thread |
nativeThread() |
void |
setPriority(int priority)
Set the priority of the thread associated with this future.
|
void |
start()
Starting a new thread in terms of a thread pool is just submitting it as
a job to the pool.
|
public RubyThread rubyThread
public FutureThread(RubyThread rubyThread, ThreadedRunnable runnable)
public Future getFuture()
public void start()
start in interface ThreadLikepublic void interrupt()
interrupt in interface ThreadLikepublic boolean isAlive()
isAlive in interface ThreadLikepublic void join()
throws InterruptedException,
ExecutionException
join in interface ThreadLikeInterruptedExceptionExecutionExceptionpublic void join(long millis)
throws InterruptedException,
ExecutionException
join in interface ThreadLikemillis - The number of millis to wait; 0 waits forever.InterruptedException - If the blocking join is interrupted
by another thread.ExecutionException - If an execution error is
raised by the underlying Future.public int getPriority()
getPriority in interface ThreadLikepublic void setPriority(int priority)
setPriority in interface ThreadLikepriority - the new prioritypublic boolean isCurrent()
isCurrent in interface ThreadLikepublic boolean isInterrupted()
isInterrupted in interface ThreadLikepublic Thread nativeThread()
nativeThread in interface ThreadLikeCopyright © 2001-2014 JRuby. All Rights Reserved.