Don't block forever in ensureKdeinitRunning
Summary:
Add more comments to the code.
Don't wait forever, if the lock is blocked for more than 30 seconds, write a warning and exit.
Test Plan:
My wife has been suffering this block for several months while I was not there, and it never happened to me.
Finally, It just has happened to me: plasmashell, ktorrent, akregator and dolphin were totally blocked.
With the help of gdb, dolphin was stopped in ensureKdeinitRunning(), apparently in tryLock(), but it was really in lock().
Reviewers: dfaure, Frameworks, thiago
Reviewed By: dfaure
Subscribers: lvsouza, kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D14302