るりまサーチ

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

別のキーワード

  1. _builtin puts
  2. csv puts
  3. stringio puts
  4. zlib puts
  5. io puts

クラス

キーワード

検索結果

Thread#run -> self (18128.0)

停止状態(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...

ThreadGroup#add(thread) -> self (57.0)

スレッド thread が属するグループを自身に変更します。

...uby]{
puts
"Initial group is #{ThreadGroup::Default.list}"
# => Initial group is [#<Thread:0x4a49168 run>]

tg = ThreadGroup.new
t1 = Thread.new { sleep }
t2 = Thread.new { sleep }
puts
"t1 is #{t1}" # => t1 is #<Thread:0x50bef60>
puts
"t2 is #{t2}" # => t2 is #<Thread:0x50beed0>
tg.add(t1)
puts
"In...
...itial group now #{ThreadGroup::Default.list}"
# => Initial group now [#<Thread:0x3039168 run>, #<Thread:0x50beed0 run>]
puts
"tg group now #{tg.list}"
# => tg group now [#<Thread:0x50bef60 run>]
//}...

Thread#wakeup -> self (31.0)

停止状態(stop)のスレッドを実行可能状態(run)にします。

...を実行可能状態(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...