Package org.jruby
Class RubyThread.SleepTask2
java.lang.Object
org.jruby.RubyThread.SleepTask2
- All Implemented Interfaces:
RubyThread.Task<Object,,Long> RubyThread.Unblocker<Object>
- Enclosing class:
- RubyThread
A Task for sleeping.
The Semaphore is immediately drained on construction, so that any subsequent acquire will block.
The sleep is interrupted by releasing a permit. All permits are drained again on exit to ensure
the next sleep blocks.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionrun(ThreadContext context, Object data) voidwakeup(RubyThread thread, Object data)
-
Field Details
-
semaphore
-
millis
long millis
-
-
Constructor Details
-
SleepTask2
private SleepTask2()
-
-
Method Details
-
run
- Specified by:
runin interfaceRubyThread.Task<Object,Long> - Throws:
InterruptedException
-
wakeup
- Specified by:
wakeupin interfaceRubyThread.Task<Object,Long> - Specified by:
wakeupin interfaceRubyThread.Unblocker<Object>
-