X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e059d69c2ce61b1ba1ae2e0b9c75eb53bb26f1bb..09047544dbeddd0a5df972934c8863bef9e11a99:/lib/components/file_eraser.cpp diff --git a/lib/components/file_eraser.cpp b/lib/components/file_eraser.cpp index bc26bf7c..eb9c82f3 100644 --- a/lib/components/file_eraser.cpp +++ b/lib/components/file_eraser.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -26,17 +27,23 @@ void eBackgroundFileEraser::idle() eBackgroundFileEraser::~eBackgroundFileEraser() { messages.send(Message::quit); - if ( thread_running() ) - kill(); if (instance==this) instance=0; + kill(); // i dont understand why this is needed .. in ~eThread::eThread is a kill() to.. } void eBackgroundFileEraser::thread() { + hasStarted(); + nice(5); + + setIoPrio(IOPRIO_CLASS_BE, 7); + reset(); + runLoop(); + stop_thread_timer.stop(); } @@ -51,8 +58,7 @@ void eBackgroundFileEraser::erase(const char *filename) else { messages.send(Message(Message::erase, strdup(buf))); - if (!thread_running()) - run(); + run(); } } } @@ -70,7 +76,7 @@ void eBackgroundFileEraser::gotMessage(const Message &msg ) eDebug("file %s erased", msg.filename); free((char*)msg.filename); } - stop_thread_timer.start(2000, true); // stop thread in two seconds + stop_thread_timer.start(1000, true); // stop thread in one seconds break; case Message::quit: quit(0);