Close keepalive fd
This commit is contained in:
@@ -12,6 +12,10 @@ KeepAlive::KeepAlive(const std::chrono::nanoseconds& max_stale, Index* index)
|
|||||||
PCHECK(shutdown_ >= 0) << "eventfd()";
|
PCHECK(shutdown_ >= 0) << "eventfd()";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KeepAlive::~KeepAlive() {
|
||||||
|
PCHECK(close(shutdown_) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
void KeepAlive::Start() {
|
void KeepAlive::Start() {
|
||||||
thread_ = std::thread([this]() {
|
thread_ = std::thread([this]() {
|
||||||
int timeout = 0;
|
int timeout = 0;
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ namespace firesse {
|
|||||||
class KeepAlive {
|
class KeepAlive {
|
||||||
public:
|
public:
|
||||||
KeepAlive(const std::chrono::nanoseconds& max_stale, Index* index);
|
KeepAlive(const std::chrono::nanoseconds& max_stale, Index* index);
|
||||||
|
~KeepAlive();
|
||||||
|
|
||||||
void Start();
|
void Start();
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user