]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
nfq: switch locking code to macro's to lock profiling can track the exact lock locations.
authorVictor Julien <victor@inliniac.net>
Wed, 28 Mar 2012 16:59:26 +0000 (18:59 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 28 Mar 2012 16:59:26 +0000 (18:59 +0200)
src/source-nfq.c

index 05493f908994484fd0ace30f8fb16b304cd47bdc..aa7c7881dc7be19e377bb8130ec9adcb1b8fd8a8 100644 (file)
@@ -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)