13#include <zypp-core/zyppng/base/private/threaddata_p.h>
14#include <zypp-core/zyppng/base/private/linuxhelpers_p.h>
18#include <condition_variable>
36 std::thread t ( [&](){
45 zyppng::blockAllSignalsForCurrentThread();
47 zyppng::ThreadData::current().setName(
"Zypp-Cleaner");
49 std::unique_lock<std::mutex> lk(
_m );
53 auto filter = []( pid_t pid ){
55 int res = waitpid( pid, &status, WNOHANG );
57 bool removeMe = ( res == -1 || res == pid );
63 _cv.wait_for( lk, std::chrono::milliseconds(100) );
70 std::condition_variable
_cv;
80 std::lock_guard<std::mutex> guard( data.
_m );
84 data.
_cv.notify_one();
static void watchPID(pid_t pid_r)
std::condition_variable _cv
std::vector< pid_t > _watchedPIDs
static CleanerData & instance()