Project

General

Profile

Bug #382 » 0001-TEST-increase-sleep-time-in-usleep-call.patch

Eric Leblond, 11/24/2011 10:31 AM

View differences:

src/flow.c
#define FLOW_DEFAULT_PREALLOC 10000
#define USLEEP_TIME 10000
void FlowRegisterTests (void);
void FlowInitFlowProto();
static int FlowUpdateSpareFlows(void);
......
}
if (run_mode != RUNMODE_PCAP_FILE) {
usleep(10);
usleep(USLEEP_TIME);
sleeping += 10;
} else {
/* If we are reading a pcap, how long the pcap timestamps
......
sleeping += tsdiff.tv_usec + (1000000 - ts.tv_usec);
else
sleeping += 100;
usleep(1);
usleep(USLEEP_TIME);
}
}
}
src/suricata.c
#include "util-memcmp.h"
#include "util-proto-name.h"
#define USLEEP_TIME 10 * 1000
/*
* we put this here, because we only use it here in main.
*/
......
break;
}
usleep(100);
usleep(USLEEP_TIME);
}
} while (done == 0);
src/tm-threads.c
#define CPU_ZERO(new_mask) (*(new_mask)).affinity_tag = THREAD_AFFINITY_TAG_NULL
#endif /* OS_FREEBSD */
#define USLEEP_TIME 10000
/* prototypes */
static int SetCPUAffinity(uint16_t cpu);
......
for (i = 0; i < (tv->inq->reader_cnt + tv->inq->writer_cnt); i++)
SCCondSignal(&trans_q[tv->inq->id].cond_q);
usleep(100);
usleep(USLEEP_TIME);
}
}
......
pthread_cond_broadcast(tv->cond);
usleep(100);
usleep(USLEEP_TIME);
}
}
......
else
SCCondSignal(&data_queues[tv->inq->id].cond_q);
}
usleep(100);
usleep(USLEEP_TIME);
}
SCLogDebug("signalled tv->inq->id %" PRIu32 "", tv->inq->id);
......
pthread_cond_broadcast(tv->cond);
usleep(100);
usleep(USLEEP_TIME);
}
}
......
void TmThreadTestThreadUnPaused(ThreadVars *tv)
{
while (TmThreadsCheckFlag(tv, THV_PAUSE)) {
usleep(100);
usleep(USLEEP_TIME);
if (TmThreadsCheckFlag(tv, THV_KILL))
break;
......
} else {
/* sleep a little to give the thread some
* time to finish initialization */
usleep(100);
usleep(USLEEP_TIME);
}
if (TmThreadsCheckFlag(tv, THV_FAILED)) {
(1-1/2)