Move ParentProcessCheckTimer to detail namespace

This commit is contained in:
Jon Siwek 2020-06-15 15:05:18 -07:00
parent 7f347a3b1e
commit d00b3a8daa
3 changed files with 6 additions and 3 deletions

View file

@ -38,7 +38,7 @@ int main(int argc, char** argv)
#endif
if ( zeek::Supervisor::ThisNode() )
timer_mgr->Add(new zeek::ParentProcessCheckTimer(1, 1));
timer_mgr->Add(new zeek::detail::ParentProcessCheckTimer(1, 1));
double time_net_start = current_time(true);;

View file

@ -140,12 +140,13 @@ static std::string make_create_message(const Supervisor::NodeConfig& node)
return fmt("create %s %s", node.name.data(), json_str.data());
}
ParentProcessCheckTimer::ParentProcessCheckTimer(double t, double arg_interval)
zeek::detail::ParentProcessCheckTimer::ParentProcessCheckTimer(double t,
double arg_interval)
: Timer(t, TIMER_PPID_CHECK), interval(arg_interval)
{
}
void ParentProcessCheckTimer::Dispatch(double t, bool is_expire)
void zeek::detail::ParentProcessCheckTimer::Dispatch(double t, bool is_expire)
{
// Note: only simple + portable way of detecting loss of parent
// process seems to be polling for change in PPID. There's platform

View file

@ -389,6 +389,7 @@ private:
std::string msg_buffer;
};
namespace detail {
/**
* A timer used by supervised processes to periodically check whether their
* parent (supervisor) process has died. If it has died, the supervised
@ -410,6 +411,7 @@ protected:
double interval;
};
}
extern Supervisor* supervisor_mgr;