threading: remove wrong unlikely statement; minor cleanups

pull/4531/head
Victor Julien 6 years ago
parent e5192ae20a
commit 2a1ed3ba1b

@ -112,19 +112,16 @@ void TmThreadsUnsetFlag(ThreadVars *tv, uint32_t flag)
* *
* \todo Deal with post_pq for slots beyond the first. * \todo Deal with post_pq for slots beyond the first.
*/ */
TmEcode TmThreadsSlotVarRun(ThreadVars *tv, Packet *p, TmEcode TmThreadsSlotVarRun(ThreadVars *tv, Packet *p, TmSlot *slot)
TmSlot *slot)
{ {
for (TmSlot *s = slot; s != NULL; s = s->slot_next) { for (TmSlot *s = slot; s != NULL; s = s->slot_next) {
PACKET_PROFILING_TMM_START(p, s->tm_id); PACKET_PROFILING_TMM_START(p, s->tm_id);
PacketQueue *post_pq = &s->slot_post_pq;
TmEcode r; if (s->id > 0) {
if (unlikely(s->id == 0)) { post_pq = NULL;
r = s->SlotFunc(tv, p, SC_ATOMIC_GET(s->slot_data), &s->slot_pre_pq, &s->slot_post_pq);
} else {
r = s->SlotFunc(tv, p, SC_ATOMIC_GET(s->slot_data), &s->slot_pre_pq, NULL);
} }
TmEcode r = s->SlotFunc(tv, p, SC_ATOMIC_GET(s->slot_data),
&s->slot_pre_pq, post_pq);
PACKET_PROFILING_TMM_END(p, s->tm_id); PACKET_PROFILING_TMM_END(p, s->tm_id);
/* handle error */ /* handle error */

Loading…
Cancel
Save