[前][次][番号順一覧][スレッド一覧]

ruby-changes:51049

From: eregon <ko1@a...>
Date: Wed, 25 Apr 2018 17:11:08 +0900 (JST)
Subject: [ruby-changes:51049] eregon:r63256 (trunk): Use Thread.pass in loop{} to check interrupts more often

eregon	2018-04-25 17:11:01 +0900 (Wed, 25 Apr 2018)

  New Revision: 63256

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63256

  Log:
    Use Thread.pass in loop{} to check interrupts more often
    
    * The spec now runs in ~5ms vs ~100ms before.

  Modified files:
    trunk/spec/ruby/core/thread/raise_spec.rb
Index: spec/ruby/core/thread/raise_spec.rb
===================================================================
--- spec/ruby/core/thread/raise_spec.rb	(revision 63255)
+++ spec/ruby/core/thread/raise_spec.rb	(revision 63256)
@@ -151,7 +151,7 @@ describe "Thread#raise on a running thre https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/thread/raise_spec.rb#L151
         1/0
       rescue ZeroDivisionError
         raised = true
-        loop { }
+        loop { Thread.pass }
       end
     end
     begin

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]