るりまサーチ (Ruby 2.5.0)

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

別のキーワード

  1. etc sc_threads
  2. etc sc_thread_threads_max
  3. etc cs_posix_v7_threads_cflags
  4. etc cs_posix_v7_threads_ldflags
  5. etc sc_xopen_realtime_threads

ライブラリ

クラス

検索結果

Thread#value -> object (54451.0)

スレッド self が終了するまで待ち(Thread#join と同じ)、 そのスレッドのブロックが返した値を返します。スレッド実行中に例外が 発生した場合には、その例外を再発生させます。

スレッド self が終了するまで待ち(Thread#join と同じ)、
そのスレッドのブロックが返した値を返します。スレッド実行中に例外が
発生した場合には、その例外を再発生させます。

スレッドが Thread#kill によって終了した場合は、返り値は不定です。

以下は、生成したすべてのスレッドの終了を待ち結果を出力する例です。

threads = []
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })...