るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

Thread#run -> self (24238.0)

停止状態(stop)のスレッドを再開させます。 Thread#wakeup と異なりすぐにスレッドの切り替え を行います。

...hread#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.r...
...un
a.join
# => a
# => Got here
# => c
//}

@see Thread#wakeup, Thread.stop...

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

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

...thread が属するグループを自身に変更します。

@param thread 自身に加えたいスレッドを指定します。

@raise ThreadError 自身が freeze されているか enclose されている場合に、発生します。また引数 thread が属する ThreadGroup が freeze...
...][ruby]{
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
...
..."Initial 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>]
//}...

OptionParser#help -> String (3131.0)

サマリの文字列を返します。

...st[例][ruby]{
r
equire "optparse"

options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"

opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end

puts
opts.help

# => Usage: example.rb [options]
# -v, --[no-]verbose...
...Run verbosely
//}...

OptionParser#to_s -> String (3131.0)

サマリの文字列を返します。

...st[例][ruby]{
r
equire "optparse"

options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"

opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end

puts
opts.help

# => Usage: example.rb [options]
# -v, --[no-]verbose...
...Run verbosely
//}...

Thread#wakeup -> self (3041.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...

絞り込み条件を変える