Close keepalive fd

This commit is contained in:
flamingcow
2019-05-12 13:49:23 -07:00
parent 9162799be0
commit 6efb19f255
2 changed files with 6 additions and 0 deletions

View File

@@ -12,6 +12,10 @@ KeepAlive::KeepAlive(const std::chrono::nanoseconds& max_stale, Index* index)
PCHECK(shutdown_ >= 0) << "eventfd()";
}
KeepAlive::~KeepAlive() {
PCHECK(close(shutdown_) == 0);
}
void KeepAlive::Start() {
thread_ = std::thread([this]() {
int timeout = 0;

View File

@@ -9,6 +9,8 @@ namespace firesse {
class KeepAlive {
public:
KeepAlive(const std::chrono::nanoseconds& max_stale, Index* index);
~KeepAlive();
void Start();
void Stop();