5件ヒット
[1-5件を表示]
(0.076秒)
別のキーワード
検索結果
先頭5件
-
Mutex
_ m # synchronize { . . . } -> object (54358.0) -
self のロックを取得し、ブロックを実行します。実行後に必ずロックを解放します。
self のロックを取得し、ブロックを実行します。実行後に必ずロックを解放します。
ブロックで最後に評価した値を返します。 -
Thread
:: Mutex # synchronize { . . . } -> object (54343.0) -
mutex をロックし、ブロックを実行します。実行後に必ず mutex のロックを解放します。
mutex をロックし、ブロックを実行します。実行後に必ず mutex のロックを解放します。
ブロックが最後に評価した値を返します。
@raise ThreadError self 既にカレントスレッドにロックされている場合に発
生します。
また、Signal.#trap に指定したハンドラ内で実行
した場合に発生します。
//emlist[例][ruby]{
m = Mutex.new
result = m.synchronize do
m.locked? # =>... -
Mutex
_ m # mu _ synchronize { . . . } -> object (18358.0) -
self のロックを取得し、ブロックを実行します。実行後に必ずロックを解放します。
self のロックを取得し、ブロックを実行します。実行後に必ずロックを解放します。
ブロックで最後に評価した値を返します。 -
Thread
:: ConditionVariable # broadcast -> self (361.0) -
状態変数を待っているスレッドをすべて再開します。再開された スレッドは Thread::ConditionVariable#wait で指定した mutex のロックを試みます。
状態変数を待っているスレッドをすべて再開します。再開された
スレッドは Thread::ConditionVariable#wait
で指定した mutex のロックを試みます。
@return 常に self を返します。
//emlist[例][ruby]{
mutex = Mutex.new
cv = ConditionVariable.new
flg = true
3.times {
Thread.start {
mutex.synchronize {
puts "a1"
while (flg)
cv.wait(mutex)
... -
Thread
:: ConditionVariable # signal -> self (361.0) -
状態変数を待っているスレッドを1つ再開します。再開された スレッドは Thread::ConditionVariable#wait で指定した mutex のロックを試みます。
状態変数を待っているスレッドを1つ再開します。再開された
スレッドは Thread::ConditionVariable#wait
で指定した mutex のロックを試みます。
@return 常に self を返します。
//emlist[例][ruby]{
mutex = Mutex.new
cv = ConditionVariable.new
flg = true
3.times {
Thread.start {
mutex.synchronize {
puts "a1"
while (flg)
cv.wait(mutex)
...