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

ruby-changes:57213

From: nagachika <ko1@a...>
Date: Thu, 22 Aug 2019 20:28:52 +0900 (JST)
Subject: [ruby-changes:57213] nagachika: fbb96f1b4d (ruby_2_6): merge revision(s) 9557069299ac3b96691040a541afa65761a724ad: [Backport #15992]

https://git.ruby-lang.org/ruby.git/commit/?id=fbb96f1b4d

From fbb96f1b4d9608ad5dd967951d4fa802ad5fe28c Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Thu, 22 Aug 2019 11:28:30 +0000
Subject: merge revision(s) 9557069299ac3b96691040a541afa65761a724ad: [Backport
 #15992]

	Avoid creating Hash objects per each mon_synchronize call (#2393)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

diff --git a/lib/monitor.rb b/lib/monitor.rb
index 5b6b14e..64b1f85 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -87,6 +87,9 @@ https://github.com/ruby/ruby/blob/trunk/lib/monitor.rb#L87
 # MonitorMixin module.
 #
 module MonitorMixin
+  EXCEPTION_NEVER = {Exception => :never}.freeze
+  EXCEPTION_IMMEDIATE = {Exception => :immediate}.freeze
+
   #
   # FIXME: This isn't documented in Nutshell.
   #
@@ -103,11 +106,11 @@ module MonitorMixin https://github.com/ruby/ruby/blob/trunk/lib/monitor.rb#L106
     # even if no other thread doesn't signal.
     #
     def wait(timeout = nil)
-      Thread.handle_interrupt(Exception => :never) do
+      Thread.handle_interrupt(EXCEPTION_NEVER) do
         @monitor.__send__(:mon_check_owner)
         count = @monitor.__send__(:mon_exit_for_cond)
         begin
-          Thread.handle_interrupt(Exception => :immediate) do
+          Thread.handle_interrupt(EXCEPTION_IMMEDIATE) do
             @cond.wait(@monitor.instance_variable_get(:@mon_mutex), timeout)
           end
           return true
@@ -227,11 +230,11 @@ module MonitorMixin https://github.com/ruby/ruby/blob/trunk/lib/monitor.rb#L230
   def mon_synchronize
     # Prevent interrupt on handling interrupts; for example timeout errors
     # it may break locking state.
-    Thread.handle_interrupt(Exception => :never){ mon_enter }
+    Thread.handle_interrupt(EXCEPTION_NEVER){ mon_enter }
     begin
       yield
     ensure
-      Thread.handle_interrupt(Exception => :never){ mon_exit }
+      Thread.handle_interrupt(EXCEPTION_NEVER){ mon_exit }
     end
   end
   alias synchronize mon_synchronize
diff --git a/version.h b/version.h
index 1b1ef96..001618f 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1
 #define RUBY_VERSION "2.6.3"
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 98
+#define RUBY_PATCHLEVEL 99
 
 #define RUBY_RELEASE_YEAR 2019
 #define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 18
+#define RUBY_RELEASE_DAY 22
 
 #include "ruby/version.h"
 
-- 
cgit v0.10.2


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

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