421件ヒット
[401-421件を表示]
(0.069秒)
クラス
- File (12)
-
File
:: Stat (24) - IO (24)
- Mutex (2)
- Pathname (12)
- SignalException (24)
- Thread (211)
-
Thread
:: ConditionVariable (24) -
Thread
:: Mutex (10) -
Thread
:: Queue (12) - ThreadGroup (24)
- ThreadsWait (42)
キーワード
- <=> (12)
-
abort
_ on _ exception (12) -
abort
_ on _ exception= (12) - add (12)
-
all
_ waits (6) - backtrace (12)
-
backtrace
_ locations (24) - birthtime (12)
- broadcast (12)
- ctime (12)
- empty? (6)
- enclose (12)
- eof (12)
- eof? (12)
- exit (12)
- finished? (6)
- flock (12)
- join (30)
-
join
_ nowait (6) - kill (12)
-
next
_ wait (6) -
num
_ waiting (12) - priority (12)
- priority= (12)
- raise (12)
- run (12)
-
safe
_ level (7) - signal (12)
- signm (12)
- signo (12)
- status (12)
- terminate (12)
- threads (6)
- value (12)
- wakeup (12)
検索結果
先頭4件
-
ThreadsWait
# all _ waits -> () (7.0) -
指定されたスレッドすべてが終了するまで待ちます。 ブロックが与えられた場合、スレッド終了時にブロックを評価します。
...スレッド終了時にブロックを評価します。
使用例
require 'thwait'
threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
thall = ThreadsWait.new(*threads)
thall.all_waits{|th|
printf("end %s\n", th.inspect)
}
# 出力例
#... -
ThreadsWait
# empty? -> bool (7.0) -
同期されるスレッドが存在するならば true をかえします。
...ッドが存在するならば true をかえします。
使用例
require 'thwait'
threads = []
3.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
thall = ThreadsWait.new
p thall.threads.empty? #=> true
thall.join(*threads)
p thall.threads.empty? #=> false... -
ThreadsWait
# join(*threads) -> () (7.0) -
終了を待つスレッドの対象として、threads で指定されたスレッドを指定します。
...了を待つスレッドに指定されたthreadsを加えます。
require 'thwait'
threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
thall = ThreadsWait.new
p thall.threads #=> []
thall.join(*threads)
p thall.threads
#=> [#<Thread:0x216ec dead... -
ThreadsWait
# next _ wait(nonblock = nil) -> Thread (7.0) -
指定したスレッドのどれかが終了するまで待ちます。
...rue でかつ、キューが空の時、発生します。
#使用例
require 'thwait'
threads = []
2.times {|i|
threads << Thread.new { sleep i }
}
thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p th
end
@see Queue#pop...