別のキーワード
種類
- インスタンスメソッド (54)
- 文書 (36)
- クラス (24)
- 特異メソッド (12)
ライブラリ
- ビルトイン (90)
クラス
- Thread (66)
キーワード
- Thread (12)
- ThreadError (12)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) - status (12)
- wakeup (12)
- スレッド (12)
検索結果
先頭5件
-
Thread
# run -> self (18135.0) -
停止状態(stop)のスレッドを再開させます。 Thread#wakeup と異なりすぐにスレッドの切り替え を行います。
...止状態(stop)のスレッドを再開させます。
Thread#wakeup と異なりすぐにスレッドの切り替え
を行います。
@raise ThreadError 死んでいるスレッドに対して実行すると発生します。
//emlist[例][ruby]{
a = Thread.new { puts "a"; Thread.stop; puts "c"......}
sleep 0.1 while a.status!='sleep'
puts "Got here"
a.run
a.join
# => a
# => Got here
# => c
//}
@see Thread#wakeup, Thread.stop... -
Thread
. stop -> nil (18135.0) -
他のスレッドから Thread#run メソッドで再起動されるまで、カレ ントスレッドの実行を停止します。
...ドから Thread#run メソッドで再起動されるまで、カレ
ントスレッドの実行を停止します。
//emlist[例][ruby]{
a = Thread.new { print "a"; Thread.stop; print "c" }
sleep 0.1 while a.status!='sleep'
print "b"
a.run
a.join
# => "abc"
//}
@see Thread#run, Thread#wakeup... -
ruby 1
. 6 feature (72.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...具合が修正さ
れました。((<ruby-bugs-ja:PR#223>))
trap(:TERM, "EXIT")
END{
puts "exit"
}
Thread.start { Thread.stop }
sleep
: 2002-04-17: Regexp#inspect
((<ruby-bugs-ja:PR#222>))
p %r{\/}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
/\\//......%w!a! "b"
^
ruby 1.6.5 (2001-10-10) [i586-linux]
: Thread
Thread#status が aborting 状態に対して "run" を返していたバグが修正
されました。また、Thread#priority = val が val でなく self を返して
いました。((<rubyi......can't dump anonymous class #<Class 0lx401ab980> (ArgumentError)
from -:1
ruby 1.6.5 (2001-10-05) [i586-linux]
: UNIXSocket#addr
UNIXSocket#addr がゴミを返していました(BSD の場合?)。
((<ruby-bugs-ja:PR#85>))
# server
require 'socket'... -
Thread
# wakeup -> self (50.0) -
停止状態(stop)のスレッドを実行可能状態(run)にします。
...停止状態(stop)のスレッドを実行可能状態(run)にします。
@raise ThreadError 死んでいるスレッドに対して実行すると発生します。
//emlist[例][ruby]{
c = Thread.new { Thread.stop; puts "hey!" }
sleep 0.1 while c.status!='sleep'
c.wakeup
c.join
# => "hey!"
//}......@see Thread#run, Thread.stop... -
Thread
# status -> String | false | nil (34.0) -
生きているスレッドの状態を文字列 "run"、"sleep", "aborting" のいず れかで返します。正常終了したスレッドに対して false、例外によ り終了したスレッドに対して nil を返します。
...生きているスレッドの状態を文字列 "run"、"sleep", "aborting" のいず
れかで返します。正常終了したスレッドに対して false、例外によ
り終了したスレッドに対して nil を返します。
Thread#alive? が真を返すなら、このメソッドも......真です。
例:
a = Thread.new { raise("die now") }
b = Thread.new { Thread.stop }
c = Thread.new { Thread.exit }
d = Thread.new { sleep }
d.kill #=> #<Thread:0x401b3678 aborting>
a.status #=> nil
b.status #=> "sleep"
c.status......#=> false
d.status #=> "aborting"
Thread.current.status #=> "run"
@see Thread#alive?, Thread#stop?... -
Thread
# report _ on _ exception -> bool (30.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...を true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent......call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Thread
# report _ on _ exception=(newstate) (30.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...を true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent......call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
ruby 1
. 8 . 3 feature (24.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...((<ruby-list:40818>))
$ cat brk.rb
def stop(n)
break if n == 2
end
(1..5).each do |i|
stop(i)
puts i
end
$ ruby-1.8.2 brk.rb
1
$ ruby-1.8.3 brk.rb
1
brk.rb:2:in `stop': unexpected break (LocalJumpError)
from b......nment" を返すようになりました。
((<"[yarv-dev:418]"|URL:http://www.atdot.net/mla/yarv-dev/418>))
=== 2005-02-17
: Test::Unit::AutoRunner.run [lib] [change]
第一引数の意味が変わりました。
=== 2005-02-14
: OpenSSL::SSL::SSLSocket#post_connection_check [lib][new]... -
Thread (18.0)
-
スレッドを表すクラスです。スレッドとはメモリ空間を共有して同時に実行される制御の流れです。 Thread を使うことで並行プログラミングが可能になります。
...atus によって見ることができます。
p Thread.new {sleep 1} # => #<Thread:0xa039de0 sleep>
: run (実行or実行可能状態)
生成されたばかりのスレッドや Thread#run や
Thread#wakeup で起こされたスレッドはこの状態です。
Thread#join でスレッドの......ドの
終了によりこの状態になります。
この状態のスレッドは「生きて」います。
: sleep (停止状態)
Thread.stop や Thread#join により停止されたスレッ
ドはこの状態になります。
この状態のスレッドは「生きて」います。...