jaor/xmobar — pull request #60 by jrk- (2012-08-22 19:35:39+00:00)
Title: Refactor MVar SignalType to TMVar SignalType 

This is mainly groundwork for the patches in my other branch/pull request.

Replace MVar with TMVar from the STM package. This is common for ghc
now. Since STM is used everywhere else in the src it also adds no
additional dependencies.

The main reason for this switch is, that readMVar, swapMVar, etc. are
only atomically if there is no other producer for this MVar i.e.
putMVar. For example readMVar is a combination of putMVar and takeMVar.
Due to scheduling and readMVar's non-atomicity it is possible that
values written to the MVar appear in the wrong order.

Using TMVar fixes this problem, since it allows really atomical
read/swap operations.