41件ヒット
[1-41件を表示]
(0.027秒)
クラス
-
CSV
:: Table (11) -
Thread
:: Queue (11) -
Thread
:: SizedQueue (7) - ThreadsWait (12)
検索結果
先頭5件
-
Thread
:: Queue # empty? -> bool (21114.0) -
キューが空の時、真を返します。
...キューが空の時、真を返します。
//emlist[例][ruby]{
require 'thread'
q = Queue.new
q.empty? # => true
q.push(:resource)
q.empty? # => false
//}......キューが空の時、真を返します。
//emlist[例][ruby]{
q = Queue.new
q.empty? # => true
q.push(:resource)
q.empty? # => false
//}... -
ThreadsWait
# empty? -> bool (21114.0) -
同期されるスレッドが存在するならば true をかえします。
...ッドが存在するならば true をかえします。
使用例
require 'thwait'
threads = []
3.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
thall = ThreadsWait.new
p thall.threads.empty? #=> true
thall.join(*threads)
p thall.threads.empty? #=> false... -
Thread
:: SizedQueue # empty? -> bool (21102.0) -
キューが空の時、真を返します。
キューが空の時、真を返します。 -
CSV
:: Table # empty? -> bool (18120.0) -
ヘッダーを除いて、データがないときに true を返します。
...ーを除いて、データがないときに true を返します。
Array#empty? に委譲しています。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b\n", headers: true)
table = csv.read
p table.empty? # => true
table << [1, 2]
p table.empty? # => false
//}
@see Array#empty?... -
ThreadsWait
# next _ wait(nonblock = nil) -> Thread (3107.0) -
指定したスレッドのどれかが終了するまで待ちます。
...ThreadsWait::ErrNoFinishedThread が発生します。
@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。
@raise ErrNoFinishedThread nonblock がtrue でかつ、キューが空の時、発生します。
#使用例
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...