rickysarraf/laptop-mode-tools — pull request #20 by schouleu (2014-03-05 23:14:14+00:00)
Title: Fix multiple hibernate issue

Reload config when locks are taken

Issue description:
We are running out of battery, two laptop-mode
instances are run concurrently, they call lmt_load_config() wich set
ON_AC=0.
The first one take locks and run lmt_main_function while the seconds
waits for locks in lock_retry().
The first one calls hibernate.
The laptop is waken with AC plugged.
The first instance exits and release locks
The second one takes locks and run lmt_main_function but still have
ON_AC=0 due to lmt_load_config() before the hibernation
The second one calls hibernate whereas we are on AC and policy says do
not hibernate on AC.