Commit ed092b96 authored by Fabian Vogt's avatar Fabian Vogt

Actually quit threads nicely

Summary:
27c0245b ("[resources] Nicely quit threads")
has no effect as the threads are not running an event loop.
Instead use the QThread::requestInterruption() mechanism.

BUG: 385533

Test Plan:
kactivitymanagerd left a coredump on each logout if kate was opened
before logging out. Now it doesn't do that anymore.

Reviewers: #plasma, ivan, anthonyfieroni

Reviewed By: #plasma, ivan

Subscribers: lbeltrame, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9998
parent 8037bae8
......@@ -56,7 +56,8 @@ Resources::Private::Private(Resources *parent)
Resources::Private::~Private()
{
quit();
requestInterruption();
wait(1500); // Enough time for the sleep(1) + processing in run()
}
namespace {
......@@ -66,7 +67,7 @@ QMutex events_mutex;
void Resources::Private::run()
{
forever {
while (!isInterruptionRequested()) {
// initial delay before processing the events
sleep(1);
......
......@@ -58,14 +58,15 @@ public:
ResourceScoreMaintainer::Private::~Private()
{
quit();
requestInterruption();
wait(1500); // Enough time for the sleep(1) + processing in run()
}
void ResourceScoreMaintainer::Private::run()
{
using namespace kamd::utils;
forever {
while (!isInterruptionRequested()) {
// initial delay before processing the resources
sleep(1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment