destruct arping thread in Arping desturctor (#578)

This commit is contained in:
Dhanya Thattil 2022-11-17 15:22:54 +01:00 committed by GitHub
parent 74a2f07c7d
commit f108ec82ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,15 @@ namespace sls {
#define gettid() syscall(SYS_gettid)
#endif
Arping::Arping(){}
Arping::~Arping() {
if (IsRunning()) {
StopThread();
}
}
void Arping::SetInterfacesAndIps(const int index, const std::string &interface,
const std::string &ip) {

View File

@ -17,6 +17,9 @@ namespace sls {
class Arping {
public:
Arping();
~Arping();
void SetInterfacesAndIps(const int index, const std::string &interface,
const std::string &ip);
pid_t GetThreadId() const;