lib/zache.rb in zache-0.13.0 vs lib/zache.rb in zache-0.13.1
- old
+ new
@@ -193,19 +193,13 @@
}
end
@hash[key][:value]
end
- def synchronized
+ def synchronized(&block)
if @sync
- @mutex.synchronize do
- # I don't know why, but if you remove this line, the tests will
- # break. It seems to me that there is a bug in Ruby. Let's try to
- # fix it or find a workaround and remove this line.
- sleep 0.00001
- yield
- end
+ @mutex.synchronize(&block)
else
- yield
+ block.call
end
end
end