Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 2adb9fd4a5
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (19 sloc) 0.249 kB
# 1000 threads, one mutex
require 'thread'
m = Mutex.new
r = 0
max = 2000
(1..max).map{
Thread.new{
i = 0
while i<max
i+=1
m.synchronize{
r += 1
}
end
}
}.each{|e|
e.join
}
raise r.to_s if r != max * max
Jump to Line
Something went wrong with that request. Please try again.