From: Victor Julien Date: Wed, 28 Mar 2012 16:59:26 +0000 (+0200) Subject: nfq: switch locking code to macro's to lock profiling can track the exact lock locations. X-Git-Tag: suricata-1.3beta1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ebb6b7faec068e1e0fe3f7aa0e2ab3640cdfffd;p=thirdparty%2Fsuricata.git nfq: switch locking code to macro's to lock profiling can track the exact lock locations. --- diff --git a/src/source-nfq.c b/src/source-nfq.c index 05493f9089..aa7c7881dc 100644 --- a/src/source-nfq.c +++ b/src/source-nfq.c @@ -269,17 +269,15 @@ static inline void NFQMutexInit(NFQQueueVars *nq) SCMutexInit(&nq->mutex_qh, NULL); } -static inline void NFQMutexLock(NFQQueueVars *nq) -{ - if (nq->use_mutex) - SCMutexLock(&nq->mutex_qh); -} - -static inline void NFQMutexUnlock(NFQQueueVars *nq) -{ - if (nq->use_mutex) - SCMutexUnlock(&nq->mutex_qh); -} +#define NFQMutexLock(nq) do { \ + if ((nq)->use_mutex) \ + SCMutexLock(&(nq)->mutex_qh); \ +} while (0) + +#define NFQMutexUnlock(nq) do { \ + if ((nq)->use_mutex) \ + SCMutexUnlock(&(nq)->mutex_qh); \ +} while (0) int NFQSetupPkt (Packet *p, struct nfq_q_handle *qh, void *data)