From 85126bf580edb675048843910c0e0c1c56c9ff89 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 12 Apr 2015 16:34:00 -0500 Subject: Fix sporadic kdesktop hang due to unsafe usage of asynchronous POSIX signals in the main GUI thread --- kdesktop/lockeng.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'kdesktop/lockeng.h') diff --git a/kdesktop/lockeng.h b/kdesktop/lockeng.h index 782f779a3..9827090b4 100644 --- a/kdesktop/lockeng.h +++ b/kdesktop/lockeng.h @@ -9,6 +9,7 @@ #define __LOCKENG_H__ #include +#include #include #include #include "KScreensaverIface.h" @@ -21,6 +22,20 @@ class DCOPClientTransaction; class TQT_DBusMessage; class TQT_DBusProxy; +class SaverEngineThreadHelperObject : public TQObject +{ + Q_OBJECT + +public slots: + void terminateThread(); + void slotLockProcessWaiting(); + void slotLockProcessFullyActivated(); + +signals: + void lockProcessWaiting(); + void lockProcessFullyActivated(); +}; + //=========================================================================== /** * Screen saver engine. Handles screensaver window, starting screensaver @@ -91,16 +106,19 @@ public: */ bool waitForLockEngage(); +signals: + void terminateHelperThread(); + void asyncLock(); + public slots: - void slotLockProcessWaiting(); - void slotLockProcessFullyActivated(); void slotLockProcessReady(); + void lockProcessWaiting(); + void lockProcessFullyActivated(); void handleDBusSignal(const TQT_DBusMessage&); protected slots: void idleTimeout(); void lockProcessExited(); - void lockProcessWaiting(); private slots: void handleSecureDialog(); @@ -148,7 +166,12 @@ protected: bool mBlankOnly; // only use the blanker, not the defined saver TQValueVector< DCOPClientTransaction* > mLockTransactions; +public: + SaverEngineThreadHelperObject* m_threadHelperObject; + private: + TQEventLoopThread* m_helperThread; + sigset_t mThreadBlockSet; TDEProcess* mSAKProcess; bool mTerminationRequested; bool mSaverProcessReady; -- cgit v1.2.1