autofac/Autofac — pull request #545 by pifil (2014-07-09 08:53:00+00:00)
Title: Fixed race condition in Disposable.Dispose()

Disposable.Dispose() and Owned.Dispose(bool) were using
Interlocked.CompareExchange but its return value was not used. The
disposal was driven by a cached local variable instead of cmpxchg result
- the actual synchronized value of the field.
For simplicity I've changed CompareExchange to Exchange only.