Remove the lock around NameCache for readBinIface.
authorThomas Schilling <nominolo@googlemail.com>
Tue, 18 Aug 2009 21:32:43 +0000 (21:32 +0000)
committerThomas Schilling <nominolo@googlemail.com>
Tue, 18 Aug 2009 21:32:43 +0000 (21:32 +0000)
commitcadba81047f6188fad2fe07004c3cb36316c36d1
treebc976b2fd4d00a7df8b2e7614afb162fdf54a94e
parentc5cafbcca54c4b1117bc43b31d86afa583fb7f62
Remove the lock around NameCache for readBinIface.

Turns out using atomic update instead of a full-blown lock was easier
than I thought.  It should also be safe in the case where we
concurrently read the same interface file.  Whichever thread loses the
race will simply find that all of the names are already defined and
will have no effect on the name cache.
compiler/iface/BinIface.hs
compiler/iface/IfaceEnv.lhs
compiler/main/HscMain.lhs
compiler/main/HscTypes.lhs