96件ヒット
[1-96件を表示]
(0.089秒)
別のキーワード
クラス
- Integer (12)
- Pathname (12)
- Thread (48)
- ThreadGroup (24)
キーワード
- add (12)
-
backtrace
_ locations (24) - list (12)
- truncate (24)
- wakeup (12)
検索結果
先頭5件
-
Thread
# run -> self (18209.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... -
Integer
# truncate(ndigits = 0) -> Integer (6117.0) -
0 から self までの整数で、自身にもっとも近い整数を返します。
...0 から self までの整数で、自身にもっとも近い整数を返します。
@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます......。
//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}
@see Numeric#truncate... -
Integer
# truncate(ndigits = 0) -> Integer | Float (6117.0) -
0 から self までの整数で、自身にもっとも近い整数を返します。
...0 から self までの整数で、自身にもっとも近い整数を返します。
@param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n......定した場合、Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1.0
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}
@see Numeric#truncate... -
Pathname
# truncate(length) -> 0 (6117.0) -
File.truncate(self.to_s, length) と同じです。
...File.truncate(self.to_s, length) と同じです。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
ThreadGroup
# add(thread) -> self (126.0) -
スレッド thread が属するグループを自身に変更します。
...9168 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>]
//}... -
Thread
# wakeup -> self (124.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... -
ThreadGroup
# list -> [Thread] (23.0) -
self に属するスレッドの配列を返します。 version 1.8 では、aborting 状態であるスレッド も要素に含まれます。つまり「生きている」スレッドの配列を返します。
...
self に属するスレッドの配列を返します。
version 1.8 では、aborting 状態であるスレッド
も要素に含まれます。つまり「生きている」スレッドの配列を返します。
//emlist[例][ruby]{
ThreadGroup::Default.list # => [#<Thread:0x00007f8f13867078... -
Thread
# backtrace _ locations(range) -> [Thread :: Backtrace :: Location] | nil (13.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...トを指定します。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block... -
Thread
# backtrace _ locations(start = 0 , length = nil) -> [Thread :: Backtrace :: Location] | nil (13.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...トを指定します。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block...