jaor/xmobar — pull request #55 by jrk- (2012-08-14 18:43:50+00:00)
Title: Bugfix: Replace the TMVar String with a TVar (Maybe String)

The problem was a race condition which occured when running multiple
threads with a small timeout value. Then the TMVar could be left empty.
(e.g. hitting a key which causes an operation to write to the pipe very fast)

This meant that tryTakeTMVar would return Nothing which would cause all
subsequent reset threads to not call cb and keep a stale string on
display.

By using a Maybe String wrapped in a TVar there is always a valid value
available which can be used to restore the display (or not if it's
Nothing, but that's desired then and not because another thread was
scheduled earlier).

Sorry for that, but concurrency can be tricky at times. :)