summaryrefslogtreecommitdiffstats
path: root/kdesktop
diff options
context:
space:
mode:
Diffstat (limited to 'kdesktop')
-rw-r--r--kdesktop/lock/lockprocess.cc1
-rw-r--r--kdesktop/lockeng.cc11
2 files changed, 4 insertions, 8 deletions
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc
index 85de4e0e1..37d2b8867 100644
--- a/kdesktop/lock/lockprocess.cc
+++ b/kdesktop/lock/lockprocess.cc
@@ -2092,7 +2092,6 @@ void LockProcess::slotPaintBackground(const TQPixmap &rpm)
setGeometry(0, 0, mRootWidth, mRootHeight);
erase();
}
-// saverReadyIfNeeded();
}
void LockProcess::preparePopup()
diff --git a/kdesktop/lockeng.cc b/kdesktop/lockeng.cc
index 27b57bc51..43930e9e7 100644
--- a/kdesktop/lockeng.cc
+++ b/kdesktop/lockeng.cc
@@ -837,15 +837,13 @@ bool SaverEngine::waitForLockProcessStart() {
sigset_t empty_mask;
sigemptyset(&empty_mask);
- // wait for SIGUSR1, SIGUSR2, SIGTTIN, SIGCHLD
+ // ensure that SIGCHLD is not subjec to a race condition
sigemptyset(&new_mask);
- sigaddset(&new_mask, SIGUSR1);
- sigaddset(&new_mask, SIGUSR2);
- sigaddset(&new_mask, SIGTTIN);
sigaddset(&new_mask, SIGCHLD);
pthread_sigmask(SIG_BLOCK, &new_mask, NULL);
while ((mLockProcess.isRunning()) && (!mSaverProcessReady)) {
+ // wait for any signal to arrive
sigsuspend(&empty_mask);
}
pthread_sigmask(SIG_UNBLOCK, &new_mask, NULL);
@@ -858,11 +856,10 @@ bool SaverEngine::waitForLockEngage() {
sigemptyset(&empty_mask);
// wait for SIGUSR1, SIGUSR2, SIGTTIN
- pthread_sigmask(SIG_BLOCK, &mThreadBlockSet, NULL);
while ((mLockProcess.isRunning()) && (mState != Waiting) && (mState != Saving)) {
+ // wait for any signal to arrive
sigsuspend(&empty_mask);
}
- pthread_sigmask(SIG_UNBLOCK, &mThreadBlockSet, NULL);
return mLockProcess.isRunning();
}
@@ -882,4 +879,4 @@ void SaverEngineThreadHelperObject::terminateThread() {
if (eventLoop) {
eventLoop->exit(0);
}
-} \ No newline at end of file
+}