Remove unnecessary locking for thread-local packet-queues breaking on Win32.

remotes/origin/master-1.0.x
Victor Julien 15 years ago
parent f4120ff5d5
commit f80016530c

@ -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 */

@ -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;
}

Loading…
Cancel
Save