るりまサーチ

最速Rubyリファレンスマニュアル検索!
30件ヒット [1-30件を表示] (0.146秒)

別のキーワード

  1. drb thread
  2. thread exit
  3. thread kill
  4. thread join
  5. etc sc_thread_cputime

ライブラリ

クラス

検索結果

Thread::Queue#empty? -> bool (35220.0)

キューが空の時、真を返します。

...キューが空の時、真を返します。

//emlist[例][ruby]{
require 'thread'
q = Queue.new
q.empty? # => true
q.push(:resource)
q.empty? # => false
//}...

ThreadsWait#empty? -> bool (27244.0)

同期されるスレッドが存在するならば true をかえします。

...ッドが存在するならば true をかえします。

使用例
require 'thwait'

thread
s = []
3.times {|i|
thread
s << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new
p
thall.threads.empty? #=> true
thall.join(*threads)
p
thall.threads.empty? #=> false...

Thread::Queue#empty? -> bool (27214.0)

キューが空の時、真を返します。

...キューが空の時、真を返します。

//emlist[例][ruby]{
q = Queue.new
q.empty? # => true
q.push(:resource)
q.empty? # => false
//}...

Thread::SizedQueue#empty? -> bool (27202.0)

キューが空の時、真を返します。

キューが空の時、真を返します。

ThreadsWait#next_wait(nonblock = nil) -> Thread (3120.0)

指定したスレッドのどれかが終了するまで待ちます。

...まで待ちます。

@param nonblock true を与えると、キューが空の時、例外 ThreadsWait::ErrNoFinishedThread が発生します。

@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。

@raise ErrNoFinishedThread nonblock がtrue でかつ...
...、キューが空の時、発生します。

#使用例
require 'thwait'

thread
s = []
2.times {|i|
thread
s << Thread.new { sleep i }
}

thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p
th
end

@see Queue#pop...

絞り込み条件を変える