Make FastString thread-safe.
authorThomas Schilling <nominolo@googlemail.com>
Mon, 24 Aug 2009 18:22:52 +0000 (18:22 +0000)
committerThomas Schilling <nominolo@googlemail.com>
Mon, 24 Aug 2009 18:22:52 +0000 (18:22 +0000)
commit738f70785e381ca2f43413a1d8efa4d5929b8231
tree4e42e546a37fa03268b80a7d32b3802726e9524e
parentd11718fa4d13519e48ef72d0b932972ce806730b
Make FastString thread-safe.

This is needed both for per-session parallelism and for allowing
multiple concurrent sessions in the same process.  With the help of
atomicModifyIORef and unsafePerformIO it is also quite fast--an MVar
would most likely be slower.  On a full compilation of Cabal's head
branch it was about 1-2 percent slower, but then overall compilation
times varied by about 4 percent, so I think it's worth it.
compiler/utils/FastString.lhs