16 #include <condition_variable> 19 #include <sys/types.h> 34 std::thread t ( [&](){
42 std::unique_lock<std::mutex> lk(
_m );
46 auto filter = []( pid_t pid ){
48 int res = waitpid( pid, &status, WNOHANG );
50 bool removeMe = ( res == -1 || res == pid );
56 _cv.wait_for( lk, std::chrono::milliseconds(100) );
63 std::condition_variable
_cv;
73 std::lock_guard<std::mutex> guard( data.
_m );
77 data.
_cv.notify_one();
static void watchPID(pid_t pid_r)
static CleanerData & instance()
std::condition_variable _cv
std::vector< pid_t > _watchedPIDs
void remove_if(LockSet &lockset_r, TPredicate pred_r)
This file contains private API, it will change without notice.