diff --git a/src/tm-threads.c b/src/tm-threads.c index 5effde7c4f..50d13bffc7 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -81,11 +81,13 @@ typedef struct TmSlot_ { void *slot_data; /**< queue filled by the SlotFunc with packets that will - * be processed futher _before_ the current packet. */ + * be processed futher _before_ the current packet. + * The locks in the queue are NOT used */ PacketQueue slot_pre_pq; /**< queue filled by the SlotFunc with packets that will - * be processed futher _after_ the current packet. */ + * be processed futher _after_ the current packet. The + * locks in the queue are NOT used */ PacketQueue slot_post_pq; /* linked list, only used by TmVarSlot */ diff --git a/src/tmqh-packetpool.c b/src/tmqh-packetpool.c index aec2f37d19..765e0ff328 100644 --- a/src/tmqh-packetpool.c +++ b/src/tmqh-packetpool.c @@ -169,12 +169,14 @@ void TmqhOutputPacketpool(ThreadVars *t, Packet *p) } /** - * \brief Release all the packets in the queue back to the packetpool. Mainly - * used by threads that have failed, and wants to return the packets back - * to the packetpool. + * \brief Release all the packets in the queue back to the packetpool. Mainly + * used by threads that have failed, and wants to return the packets back + * to the packetpool. * - * \param pq Pointer to the packetqueue from which the packets have to be - * returned back to the packetpool + * \param pq Pointer to the packetqueue from which the packets have to be + * returned back to the packetpool + * + * \warning this function assumes that the pq does not use locking */ void TmqhReleasePacketsToPacketPool(PacketQueue *pq) { @@ -183,12 +185,8 @@ void TmqhReleasePacketsToPacketPool(PacketQueue *pq) if (pq == NULL) return; - SCMutexLock(&pq->mutex_q); - while ( (p = PacketDequeue(pq)) != NULL) TmqhOutputPacketpool(NULL, p); - SCMutexUnlock(&pq->mutex_q); - return; }