Backport #8097

Mutex#synchronize block param oddity

Added by Peter Suschlik about 1 year ago. Updated about 1 year ago.

[ruby-core:53424]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

Description

In 1.9.3 Mutex#synchronize yield nothing.

In 2.0.0 Mutex#synchronize yields nil.

require 'thread'

Mutex.new.synchronize do |*args|
p RUBY_VERSION => args
end

See https://gist.github.com/splattael/5164747

Associated revisions

Revision 40380
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) 40000: [Backport #8097]

* thread.c (rb_mutex_synchronize_m): yield no block params.  patch by
  splattael (Peter Suschlik) in  [Bug #8097].
  fix GH-266.

History

#1 Updated by Peter Suschlik about 1 year ago

I've create a pull request on GitHub which fixes this issue:
https://github.com/ruby/ruby/pull/266

The patch:
https://github.com/ruby/ruby/pull/266.patch

#2 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40000.
Peter, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


thread.c: Mutex#synchronize no block params

  • thread.c (rbmutexsynchronize_m): yield no block params. patch by splattael (Peter Suschlik) in [Bug #8097]. fix GH-266.

#3 Updated by Tomoyuki Chikanaga about 1 year ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport200
  • Status changed from Closed to Assigned
  • Assignee set to Tomoyuki Chikanaga

I believe this is a regression of 2.0.0-p0. I'll backport r40000 to ruby20_0.

#4 Updated by Tomoyuki Chikanaga about 1 year ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40380.
Peter, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 40000: [Backport #8097]

* thread.c (rb_mutex_synchronize_m): yield no block params.  patch by
  splattael (Peter Suschlik) in  [Bug #8097].
  fix GH-266.

Also available in: Atom PDF