[ruby-dev:49240] [Ruby trunk - Bug #11496] [Open] Mutex#synchronize testing code should be data race.
From:
co000ri@...
Date:
2015-08-31 04:08:30 UTC
List:
ruby-dev #49240
Issue #11496 has been reported by Yuki Kurihara.
----------------------------------------
Bug #11496: Mutex#synchronize testing code should be data race.
https://bugs.ruby-lang.org/issues/11496
* Author: Yuki Kurihara
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-08-28 trunk 51715) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Current Mutex#synchronize testing code is not to fail every time if not use Mutex#synchronize.
~~~ruby
100.times {
r = 0
max = 10
(1..max).map{
Thread.new{
i=0
while i<max*max
i+=1
r += 1
end
}
}.each{|e|
e.join
}
raise unless r == 1000
}
puts "pass"
~~~
So, I propose this patch.
---Files--------------------------------
mutex-synchronize.patch (424 Bytes)
--
https://bugs.ruby-lang.org/