るりまサーチ

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

別のキーワード

  1. drb thread
  2. thread exit
  3. thread join
  4. thread kill
  5. tracer get_thread_no

ライブラリ

キーワード

検索結果

Thread::ConditionVariable.new -> Thread::ConditionVariable (11102.0)

状態変数を生成して返します。

状態変数を生成して返します。

Thread::ConditionVariable#wait(mutex, timeout = nil) -> self (11051.0)

mutex のロックを解放し、カレントスレッドを停止します。 Thread::ConditionVariable#signalまたは、 Thread::ConditionVariable#broadcastで送られたシグナルを 受け取ると、mutexのロックを取得し、実行状態となります。

...レントスレッドを停止します。
Thread::ConditionVariable
#signalまたは、
Thread::ConditionVariable
#broadcastで送られたシグナルを
受け取ると、mutexのロックを取得し、実行状態となります。

@param mutex Thread::Mutex オブジェクトを指定します...
...ます。この場合はシグナルを受け取
らなかった場合でも指定した秒数が経過するとスリープを終了
します。省略するとスリープし続けます。

@see Thread::ConditionVariable#signal, Thread::ConditionVariable#broadcast...

Thread::ConditionVariable#broadcast -> self (11029.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 {
pu...
...ts "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
//}...

Thread::ConditionVariable#signal -> self (11029.0)

状態変数を待っているスレッドを1つ再開します。再開された スレッドは 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 {
pu...
...ts "a1"
while (flg)
cv.wait(mutex)
end
puts "a2"
}
}
}

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

sleep 1

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

Thread::ConditionVariable.new -> Thread::ConditionVariable (3102.0)

状態変数を生成して返します。

状態変数を生成して返します。

絞り込み条件を変える

Thread::ConditionVariable#wait(mutex, timeout = nil) -> self (3045.0)

mutex のロックを解放し、カレントスレッドを停止します。 Thread::ConditionVariable#signalまたは、 Thread::ConditionVariable#broadcastで送られたシグナルを 受け取ると、mutexのロックを取得し、実行状態となります。

...mutex のロックを解放し、カレントスレッドを停止します。
Thread::ConditionVariable
#signalまたは、
Thread::ConditionVariable
#broadcastで送られたシグナルを
受け取ると、mutexのロックを取得し、実行状態となります。

@param mutex Mutex オブ...
...ます。この場合はシグナルを受け取
らなかった場合でも指定した秒数が経過するとスリープを終了
します。省略するとスリープし続けます。

@see Thread::ConditionVariable#signal, Thread::ConditionVariable#broadcast...

Thread::ConditionVariable#broadcast -> self (3029.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 {
pu...
...ts "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
//}...

Thread::ConditionVariable#signal -> self (3029.0)

状態変数を待っているスレッドを1つ再開します。再開された スレッドは 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 {
pu...
...ts "a1"
while (flg)
cv.wait(mutex)
end
puts "a2"
}
}
}

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

sleep 1

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