3件ヒット
[1-3件を表示]
(0.156秒)
クラス
-
CSV
:: Table (1) - ThreadsWait (2)
検索結果
先頭3件
-
CSV
:: Table # empty? -> bool (63661.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
# empty? -> bool (54661.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 -
ThreadsWait
# next _ wait(nonblock = nil) -> Thread (340.0) -
指定したスレッドのどれかが終了するまで待ちます。
指定したスレッドのどれかが終了するまで待ちます。
@param nonblock true を与えると、キューが空の時、例外 ThreadsWait::ErrNoFinishedThread が発生します。
@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。
@raise ErrNoFinishedThread nonblock がtrue でかつ、キューが空の時、発生します。
#使用例
require 'thwait'
threads = []
2.times {|i|
threads << Thread.n...