18件ヒット
[1-18件を表示]
(0.077秒)
種類
- クラス (9)
- インスタンスメソッド (9)
クラス
検索結果
-
Thread
:: SizedQueue # max=(n) (29108.0) -
キューの最大サイズを設定します。
...キューの最大サイズを設定します。
@param n キューの最大サイズを指定します。
//emlist[例][ruby]{
q = SizedQueue.new(4)
q.max # => 4
q.max = 5
q.max # => 5
//}... -
Thread
:: ConditionVariable (8020.0) -
スレッドの同期機構の一つである状態変数を実現するクラスです。
...。
require 'thread'
class TinyQueue
def initialize(max=2)
@max = max
@full = ConditionVariable.new
@empty = ConditionVariable.new
@mutex = Mutex.new
@q = []
end
def count
@q.size
end
def enq(v)
@mutex.synchronize{
@full.w...