#include <chrono>
#include <thread>
void thread_task(int n) {
while(true)
{
std::this_thread::sleep_for(std::chrono::seconds(n));
static char state = 0; //state = 0~1
LOG_D("server enter into test task. State: %d.", state);
//Test Code
state++;
if(state > 1)
{
state = 0;
}
}
}
int main(int argc, char **argv)
{
std::thread test_thread;
test_thread = std::thread(thread_task, 10);
test_thread.detach();
}