rspec/rspec-mocks — pull request #634 by xaviershay (2014-03-22 17:40:23+00:00)
Title: Make RSpec::Mocks::Space more thread-safe.

It used to be possible for different threads to receive different proxy
objects, potentially a source of bugs such as #380.

This is non-trivial to write a spec for, but you can trivially
demonstrate the problem by adding a `sleep` into the fetch blocks, and
then running:

o = Object.new
t = Thread.new do
RSpec::Mocks.space.proxy_for(o)
end
b = RSpec::Mocks.space.proxy_for(o)
a = t.value

expect(a).to eq(b)

@myronmarston @knewter @alindeman