Age | Commit message (Collapse) | Author |
|
|
|
|
|
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.
|
|
It's easy to implement, since arguments to dbus method calls are handed
over as list anyway. It also removes the need for safeHead.
Bottom line: extra functionality without extra cost.
|
|
connectSession throws a ClientError Exception when
DBUS_SESSION_BUS_ADDRESS is unset. Without exception handler this will
result in program termination.
Since the DBus handler merely sends a signal to the event loop it does
no harm when it won't run. Normal operation will continue just if
compiled without dbus support.
|
|
This belongs here, otherwise ghc will complain about orphaned instances
|
|
safeHead is a very general utility function with suits better into a
common Util module.
|
|
|