#ifdef HAVE_PACKET_EBPF
int tcount = 0;
BypassedFlowManagerThreadData *ftd = thread_data;
-
while (1) {
int i;
SCLogDebug("Dumping the table");
if (clock_gettime(CLOCK_MONOTONIC, &curtime) != 0) {
SCLogWarning(SC_ERR_INVALID_VALUE, "Can't get time: %s (%d)",
strerror(errno), errno);
- sleep(1);
+ usleep(10000);
continue;
}
for (i = 0; i < g_bypassed_func_max_index; i++) {
StatsSyncCounters(th_v);
return TM_ECODE_OK;
}
- sleep(FLOW_BYPASS_DELAY);
- StatsSyncCountersIfSignalled(th_v);
+ for (i = 0; i < FLOW_BYPASS_DELAY * 100; i++) {
+ if (TmThreadsCheckFlag(th_v, THV_KILL)) {
+ StatsSyncCounters(th_v);
+ return TM_ECODE_OK;
+ }
+ StatsSyncCountersIfSignalled(th_v);
+ usleep(10000);
+ }
}
#endif
return TM_ECODE_OK;