ライブラリ
- ビルトイン (76)
-
io
/ wait (48) - monitor (42)
-
net
/ telnet (4) -
shell
/ builtin-command (6) -
shell
/ process-controller (6) -
shell
/ system-command (6) - socket (12)
- sync (24)
- thread (6)
- thwait (18)
クラス
-
ARGF
. class (10) - IO (72)
- Monitor (6)
-
MonitorMixin
:: ConditionVariable (36) -
Net
:: Telnet (4) -
Process
:: Status (12) -
Shell
:: BuiltInCommand (6) -
Shell
:: ProcessController (6) -
Shell
:: SystemCommand (6) - Socket (12)
-
Thread
:: ConditionVariable (36) - ThreadsWait (18)
モジュール
-
Sync
_ m (24)
キーワード
- >> (12)
- broadcast (12)
-
connect
_ nonblock (12) - join (6)
-
join
_ nowait (6) -
next
_ wait (6) -
read
_ nonblock (22) - signal (12)
-
sync
_ upgrade _ waiting (6) -
sync
_ upgrade _ waiting= (6) -
sync
_ waiting (6) -
sync
_ waiting= (6) - wait? (12)
-
wait
_ for _ cond (6) -
wait
_ readable (12) -
wait
_ until (12) -
wait
_ while (12) -
wait
_ writable (24) - waitfor (4)
-
waiting
_ job? (6) -
write
_ nonblock (12)
検索結果
先頭5件
-
MonitorMixin
:: ConditionVariable # wait(timeout = nil) -> bool (18132.0) -
モニタのロックを開放し、現在のスレッドを停止します。
...す。
@param timeout タイムアウトまでの秒数。指定しなかった場合はタイムアウトしません。
@raise ThreadError ロックを持っていないスレッドがこのメソッドを呼びだした場合に発生します
@see MonitorMixin::ConditionVariable#wait_while, M......onitorMixin::ConditionVariable#wait_until... -
IO
# wait(timeout = nil) -> bool | self | nil (18121.0) -
self が読み込み可能になるまでブロックし、読み込み可能になったら 真値を返します。タイムアウト、もしくはEOFで それ以上読みこめない場合は偽の値を返します。
...timeout を指定した場合は、指定秒数経過するまでブロックし、タ
イムアウトした場合は nil を返します。
self が EOF に達していれば false を返します。
@param timeout タイムアウトまでの秒数を指定します。
@see IO#wait_writable... -
Thread
:: ConditionVariable # wait(mutex , timeout = nil) -> self (18120.0) -
mutex のロックを解放し、カレントスレッドを停止します。 Thread::ConditionVariable#signalまたは、 Thread::ConditionVariable#broadcastで送られたシグナルを 受け取ると、mutexのロックを取得し、実行状態となります。
...castで送られたシグナルを
受け取ると、mutexのロックを取得し、実行状態となります。
@param mutex Thread::Mutex オブジェクトを指定します。
@param timeout スリープする秒数を指定します。この場合はシグナルを受け取......らなかった場合でも指定した秒数が経過するとスリープを終了
します。省略するとスリープし続けます。
@see Thread::ConditionVariable#signal, Thread::ConditionVariable#broadcast......roadcastで送られたシグナルを
受け取ると、mutexのロックを取得し、実行状態となります。
@param mutex Mutex オブジェクトを指定します。
@param timeout スリープする秒数を指定します。この場合はシグナルを受け取
ら......なかった場合でも指定した秒数が経過するとスリープを終了
します。省略するとスリープし続けます。
@see Thread::ConditionVariable#signal, Thread::ConditionVariable#broadcast... -
ThreadsWait
# next _ wait(nonblock = nil) -> Thread (9132.0) -
指定したスレッドのどれかが終了するまで待ちます。
...が終了するまで待ちます。
@param nonblock true を与えると、キューが空の時、例外 ThreadsWait::ErrNoFinishedThread が発生します。
@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。
@raise ErrNoFinishedThread nonblock が......rue でかつ、キューが空の時、発生します。
#使用例
require 'thwait'
threads = []
2.times {|i|
threads << Thread.new { sleep i }
}
thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p th
end
@see Queue#pop... -
ThreadsWait
# join _ nowait(*threads) -> () (9107.0) -
終了を待つスレッドの対象として、threads で指定されたスレッドを指定します。 しかし、実際には終了をまちません。
...。
@param threads 複数スレッドの終了を待つスレッドに指定されたthreadsを加えます。
require 'thwait'
threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
thall = ThreadsWait.new
p thall.threads #=> []
thall.join_nowait(*thre... -
Monitor
# wait _ for _ cond(cond , timeout) -> bool (6126.0) -
MonitorMixin::ConditionVariable 用の内部メソッドです。
...torMixin::ConditionVariable 用の内部メソッドです。
@param cond Thread::ConditionVariable を指定します。
@param timeout タイムアウトまでの秒数。指定しなかった場合はタイムアウトしません。
@return タイムアウトしたときは false を返しま......す。それ以外は true を返します。
//emlist[例][ruby]{
require 'monitor'
m = Monitor.new
cv = Thread::ConditionVariable.new
m.enter
m.wait_for_cond(cv, 1)
//}... -
Monitor
# wait _ for _ cond(cond , timeout) -> true (6126.0) -
MonitorMixin::ConditionVariable 用の内部メソッドです。
...torMixin::ConditionVariable 用の内部メソッドです。
@param cond Thread::ConditionVariable を指定します。
@param timeout タイムアウトまでの秒数。指定しなかった場合はタイムアウトしません。
@return Ruby 1.9 の頃からのバグで常に true を返......します。(16608)
//emlist[例][ruby]{
require 'monitor'
m = Monitor.new
cv = Thread::ConditionVariable.new
m.enter
m.wait_for_cond(cv, 1)
//}... -
IO
# wait _ readable(timeout = nil) -> bool | self | nil (6121.0) -
self が読み込み可能になるまでブロックし、読み込み可能になったら 真値を返します。タイムアウト、もしくはEOFで それ以上読みこめない場合は偽の値を返します。
...timeout を指定した場合は、指定秒数経過するまでブロックし、タ
イムアウトした場合は nil を返します。
self が EOF に達していれば false を返します。
@param timeout タイムアウトまでの秒数を指定します。
@see IO#wait_writable... -
IO
# wait _ writable -> self (6121.0) -
self が書き込み可能になるまでブロックし、書き込み可能になったら self を 返します。
...、書き込み可能になったら self を
返します。
timeout を指定した場合は、指定秒数経過するまでブロックし、タイムアウト
した場合は nil を返します。
@param timeout タイムアウトまでの秒数を指定します。
@see IO#wait_readable... -
IO
# wait _ writable(timeout) -> self | nil (6121.0) -
self が書き込み可能になるまでブロックし、書き込み可能になったら self を 返します。
...、書き込み可能になったら self を
返します。
timeout を指定した場合は、指定秒数経過するまでブロックし、タイムアウト
した場合は nil を返します。
@param timeout タイムアウトまでの秒数を指定します。
@see IO#wait_readable... -
MonitorMixin
:: ConditionVariable # wait _ while { . . . } -> () (6120.0) -
モニタのロックを開放し、現在のスレッドを ブロックで指定した条件を満たしている間停止します。
...このメソッドから抜け処理を継続するか
再びロックを開放しスレッドを停止するかを決めます。
@raise ThreadError ロックを持っていないスレッドがこのメソッドを呼びだした場合に発生します
@see MonitorMixin::ConditionVariable#wait...