るりまサーチ

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

別のキーワード

  1. _builtin nil?
  2. object nil?
  3. nilclass nil?
  4. object nil
  5. _builtin nil

クラス

キーワード

検索結果

Thread.pass -> nil (18216.0)

他のスレッドに実行権を譲ります。実行中のスレッドの状態を変えずに、 他の実行可能状態のスレッドに制御を移します。

...権を譲ります。実行中のスレッドの状態を変えずに、
他の実行可能状態のスレッドに制御を移します。

Thread.new do
(1..3).each{|i|
p i
Thread.pass
}
exit
end

loop do
Thread.pass
p :main
end

#=>
1
:main
2
:main
3
:main...

Module#ruby2_keywords(method_name, ...) -> nil (109.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument...
...at method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through the method to
other methods.

This should only be used for methods that delegate keywords to another
method, and only for backwards comp...
...responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
method will change so that it does not pass through keywords.

//emlist[例][ruby]{
module Mod
def foo(meth, *args, &block)
send(:"do_#{meth}", *args, &block)
end
ruby2_keywords(:f...

Thread.pending_interrupt?(error = nil) -> bool (109.0)

非同期割り込みのキューが空かどうかを返します。

...例外をただちに発生させる。

def Thread.kick_interrupt_immediately
Thread.handle_interrupt(Object => :immediate) {
Thread.pass
}
end

=== 使い方

th = Thread.new{
Thread.handle_interrupt(RuntimeError => :on_blocking){
while true
...
# こ...