120件ヒット
[101-120件を表示]
(0.075秒)
別のキーワード
クラス
- Monitor (12)
- Mutex (2)
-
PStore
:: DummyMutex (12) -
Thread
:: ConditionVariable (24) -
Thread
:: Mutex (10)
モジュール
- MonitorMixin (24)
-
Mutex
_ m (24) -
Sync
_ m (12)
キーワード
- broadcast (12)
-
mon
_ synchronize (18) -
mu
_ synchronize (12) - signal (12)
-
sync
_ synchronize (6)
検索結果
-
Thread
:: ConditionVariable # broadcast -> self (13.0) -
状態変数を待っているスレッドをすべて再開します。再開された スレッドは Thread::ConditionVariable#wait で指定した mutex のロックを試みます。
...w
cv = ConditionVariable.new
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
#... -
Thread
:: ConditionVariable # signal -> self (13.0) -
状態変数を待っているスレッドを1つ再開します。再開された スレッドは Thread::ConditionVariable#wait で指定した mutex のロックを試みます。
...w
cv = ConditionVariable.new
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.signal
}
}
sleep 1
# => a1
# => a1
# => a1
# =>...