enhance: add configuration items to adjust the scheduling parameters of the main loop

This commit is contained in:
luwenpeng
2024-08-15 19:03:48 +08:00
parent 42f44b53b1
commit b0e08133b7
8 changed files with 239 additions and 26 deletions

View File

@@ -197,6 +197,7 @@ static void *dumpfile_thread(void *arg)
PACKET_IO_LOG_STATE("dumpfile io thread is running");
scan_directory(handle->directory, dumpfile_handler, arg);
PACKET_IO_LOG_STATE("dumpfile io thread processed all pcap files");
while (ATOMIC_READ(&handle->io_thread_need_exit) == 0)
{
@@ -205,11 +206,10 @@ static void *dumpfile_thread(void *arg)
ATOMIC_SET(&handle->io_thread_wait_exit, 1);
}
PACKET_IO_LOG_STATE("dumpfile io thread has processed all pcap files, wait for exit");
sleep(1);
usleep(1000); // 1ms
}
PACKET_IO_LOG_STATE("dumpfile io thread exit !!!");
PACKET_IO_LOG_STATE("dumpfile io thread exit");
ATOMIC_SET(&handle->io_thread_is_runing, 0);
return NULL;