You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KED/ked/oldDevFiles/depricated/training/time_logger/logger.cpp

34 lines
425 B

#include "logger.hpp"
Logger::Logger()
{
if(pthread_create(&thread_handle,
NULL,
_static_run,
this) != 0) {
std::cout << "failed to ctrate logger tast!" <<std::endl;
exit(-1);
}
}
pthread_t Logger::get_thread_handle()
{
return thread_handle;
}
void Logger::_run()
{
while(1) {
usleep(10000);
}
}
void Logger::_static_run(void* arg)
{
reinterpret_cast<Logger*>(arg)->_run();
}