るりまサーチ

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

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. zlib end

ライブラリ

クラス

検索結果

Thread::ConditionVariable#broadcast -> self (18114.0)

状態変数を待っているスレッドをすべて再開します。再開された スレッドは Thread::ConditionVariable#wait で指定した mutex のロックを試みます。

...w
flg = true

3.times {
Thread.start {
mutex.synchronize {
puts "a1"
while (flg)
cv.wait(mutex)
end

puts "a2"
}
}
}

Thread.start {
mutex.synchronize {
flg = false
cv.broadcast
}
}

sleep 1

# => a1
# => a1
# => a1
# => a2
# => a2
# => a2
//}...