This code isn't thread-safe, but should be. Although we don't have any formal tests of this, I believe that AutoFixture is thread-safe - at least, it ought to be.

I agree that it's impossible to write a deterministic unit test that verifies that no threading issues occur, but that's why we also perform code reviews :)

There are at least three ways to address this issue:

- Put a lock around the code in this method. This is the easiest, but possibly also the slowest solution.
- Use a [ReaderWriterLockSlim](http://msdn.microsoft.com/en-us/library/Bb300132.aspx). Combined with double-checked locking, that's most likely going to be faster than the first option.
- Use a [ConcurrentDictionary](http://msdn.microsoft.com/en-us/library/dd287191.aspx). I don't know if that's faster or slower than a ReaderWriterLockSlim.