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; void *slot_data;
/**< queue filled by the SlotFunc with packets that will /**< 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; PacketQueue slot_pre_pq;
/**< queue filled by the SlotFunc with packets that will /**< 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; PacketQueue slot_post_pq;
/* linked list, only used by TmVarSlot */ /* 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 * \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 * used by threads that have failed, and wants to return the packets back
* to the packetpool. * to the packetpool.
* *
* \param pq Pointer to the packetqueue from which the packets have to be * \param pq Pointer to the packetqueue from which the packets have to be
* returned back to the packetpool * returned back to the packetpool
*
* \warning this function assumes that the pq does not use locking
*/ */
void TmqhReleasePacketsToPacketPool(PacketQueue *pq) void TmqhReleasePacketsToPacketPool(PacketQueue *pq)
{ {
@ -183,12 +185,8 @@ void TmqhReleasePacketsToPacketPool(PacketQueue *pq)
if (pq == NULL) if (pq == NULL)
return; return;
SCMutexLock(&pq->mutex_q);
while ( (p = PacketDequeue(pq)) != NULL) while ( (p = PacketDequeue(pq)) != NULL)
TmqhOutputPacketpool(NULL, p); TmqhOutputPacketpool(NULL, p);
SCMutexUnlock(&pq->mutex_q);
return; return;
} }

Loading…
Cancel
Save