aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-29 13:09:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-29 13:09:52 +0000
commit99155e20a0077e423a2c44551a70f6b01746f36f (patch)
tree0f3a58e66522ee87801cd5f6299625ea366abd44
parent2418b20897ee9a4077cb98aab10249d1d1843cf9 (diff)
downloadruby-99155e20a0077e423a2c44551a70f6b01746f36f.tar.gz
thread.c: Mutex#synchronize no block params
* thread.c (rb_mutex_synchronize_m): yield no block params. patch by splattael (Peter Suschlik) in [ruby-core:53773] [Bug #8097]. fix GH-266. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_thread.rb5
-rw-r--r--thread.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fbe0862f07..6c84799da0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Mar 29 22:09:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread.c (rb_mutex_synchronize_m): yield no block params. patch by
+ splattael (Peter Suschlik) in [ruby-core:53773] [Bug #8097].
+ fix GH-266.
+
Fri Mar 29 16:51:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (argf_next_argv): set init flag if succeeded to forward, after
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 63921bb2da..668f3741e3 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -120,6 +120,11 @@ class TestThread < Test::Unit::TestCase
assert_equal(max * max * max, r)
end
+ def test_mutex_synchronize_yields_no_block_params
+ bug8097 = '[ruby-core:53424] [Bug #8097]'
+ assert_empty(Mutex.new.synchronize {|*params| break params}, bug8097)
+ end
+
def test_local_barrier
dir = File.dirname(__FILE__)
lbtest = File.join(dir, "lbtest.rb")
diff --git a/thread.c b/thread.c
index c510b93e9a..5312648a57 100644
--- a/thread.c
+++ b/thread.c
@@ -4567,7 +4567,7 @@ rb_mutex_synchronize_m(VALUE self, VALUE args)
rb_raise(rb_eThreadError, "must be called with a block");
}
- return rb_mutex_synchronize(self, rb_yield, Qnil);
+ return rb_mutex_synchronize(self, rb_yield, Qundef);
}
void rb_mutex_allow_trap(VALUE self, int val)