suricata
threads.h File Reference
#include "util-cpu.h"
#include <pthread.h>
Include dependency graph for threads.h:

Go to the source code of this file.

Macros

#define SCMutex   pthread_mutex_t
 
#define SCMutexAttr   pthread_mutexattr_t
 
#define SCMutexInit(mut, mutattr)   pthread_mutex_init(mut, mutattr)
 
#define SCMutexLock(mut)   pthread_mutex_lock(mut)
 
#define SCMutexTrylock(mut)   pthread_mutex_trylock(mut)
 
#define SCMutexUnlock(mut)   pthread_mutex_unlock(mut)
 
#define SCMutexDestroy   pthread_mutex_destroy
 
#define SCMUTEX_INITIALIZER   PTHREAD_MUTEX_INITIALIZER
 
#define SCRWLock   pthread_rwlock_t
 
#define SCRWLockInit(rwl, rwlattr)   pthread_rwlock_init(rwl, rwlattr)
 
#define SCRWLockWRLock(rwl)   pthread_rwlock_wrlock(rwl)
 
#define SCRWLockRDLock(rwl)   pthread_rwlock_rdlock(rwl)
 
#define SCRWLockTryWRLock(rwl)   pthread_rwlock_trywrlock(rwl)
 
#define SCRWLockTryRDLock(rwl)   pthread_rwlock_tryrdlock(rwl)
 
#define SCRWLockUnlock(rwl)   pthread_rwlock_unlock(rwl)
 
#define SCRWLockDestroy   pthread_rwlock_destroy
 
#define SCCondT   pthread_cond_t
 
#define SCCondInit   pthread_cond_init
 
#define SCCondSignal   pthread_cond_signal
 
#define SCCondDestroy   pthread_cond_destroy
 
#define SCCondWait(cond, mut)   pthread_cond_wait(cond, mut)
 
#define SCCtrlMutex   pthread_mutex_t
 
#define SCCtrlMutexAttr   pthread_mutexattr_t
 
#define SCCtrlMutexInit(mut, mutattr)   pthread_mutex_init(mut, mutattr)
 
#define SCCtrlMutexLock(mut)   pthread_mutex_lock(mut)
 
#define SCCtrlMutexTrylock(mut)   pthread_mutex_trylock(mut)
 
#define SCCtrlMutexUnlock(mut)   pthread_mutex_unlock(mut)
 
#define SCCtrlMutexDestroy   pthread_mutex_destroy
 
#define SCCtrlCondT   pthread_cond_t
 
#define SCCtrlCondInit   pthread_cond_init
 
#define SCCtrlCondSignal   pthread_cond_signal
 
#define SCCtrlCondTimedwait   pthread_cond_timedwait
 
#define SCCtrlCondWait   pthread_cond_wait
 
#define SCCtrlCondDestroy   pthread_cond_destroy
 
#define SCSpinlock   SCMutex
 
#define SCSpinLock(spin)   SCMutexLock((spin))
 
#define SCSpinTrylock(spin)   SCMutexTrylock((spin))
 
#define SCSpinUnlock(spin)   SCMutexUnlock((spin))
 
#define SCSpinInit(spin, spin_attr)   SCMutexInit((spin), NULL)
 
#define SCSpinDestroy(spin)   SCMutexDestroy((spin))
 
#define SCGetThreadIdLong(...)
 
#define SCSetThreadName(n)   (0)
 

Enumerations

enum  { PRIO_LOW = 2, PRIO_MEDIUM = 0, PRIO_HIGH = -2 }
 

Functions

void ThreadMacrosRegisterTests (void)
 this function registers unit tests for DetectId More...
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t
Pablo Rincon Crespo pablo.nosp@m..rin.nosp@m.con.c.nosp@m.resp.nosp@m.o@gma.nosp@m.il.c.nosp@m.om

Threading functions defined as macros

Definition in file threads.h.

Macro Definition Documentation

#define SCCondDestroy   pthread_cond_destroy

Definition at line 139 of file threads.h.

#define SCCondInit   pthread_cond_init

Definition at line 137 of file threads.h.

#define SCCondSignal   pthread_cond_signal

Definition at line 138 of file threads.h.

#define SCCondT   pthread_cond_t

Definition at line 136 of file threads.h.

#define SCCondWait (   cond,
  mut 
)    pthread_cond_wait(cond, mut)

Definition at line 140 of file threads.h.

#define SCCtrlCondDestroy   pthread_cond_destroy

Definition at line 157 of file threads.h.

#define SCCtrlCondInit   pthread_cond_init

Definition at line 153 of file threads.h.

#define SCCtrlCondSignal   pthread_cond_signal

Definition at line 154 of file threads.h.

#define SCCtrlCondT   pthread_cond_t

Definition at line 152 of file threads.h.

#define SCCtrlCondTimedwait   pthread_cond_timedwait

Definition at line 155 of file threads.h.

#define SCCtrlCondWait   pthread_cond_wait

Definition at line 156 of file threads.h.

#define SCCtrlMutex   pthread_mutex_t

Definition at line 143 of file threads.h.

#define SCCtrlMutexAttr   pthread_mutexattr_t

Definition at line 144 of file threads.h.

#define SCCtrlMutexDestroy   pthread_mutex_destroy

Definition at line 149 of file threads.h.

#define SCCtrlMutexInit (   mut,
  mutattr 
)    pthread_mutex_init(mut, mutattr)

Definition at line 145 of file threads.h.

#define SCCtrlMutexLock (   mut)    pthread_mutex_lock(mut)

Definition at line 146 of file threads.h.

#define SCCtrlMutexTrylock (   mut)    pthread_mutex_trylock(mut)

Definition at line 147 of file threads.h.

#define SCCtrlMutexUnlock (   mut)    pthread_mutex_unlock(mut)

Definition at line 148 of file threads.h.

#define SCGetThreadIdLong (   ...)
Value:
({ \
pid_t tmpthid; \
tmpthid = syscall(SYS_gettid); \
u_long _scgetthread_tid = (u_long)tmpthid; \
_scgetthread_tid; \
})

Get the Current Thread Id

Definition at line 255 of file threads.h.

Referenced by TmSlotGetSlotForTM(), and TmThreadSetupOptions().

#define SCMutex   pthread_mutex_t

Definition at line 116 of file threads.h.

#define SCMUTEX_INITIALIZER   PTHREAD_MUTEX_INITIALIZER

Definition at line 123 of file threads.h.

#define SCMutexAttr   pthread_mutexattr_t

Definition at line 117 of file threads.h.

#define SCMutexDestroy   pthread_mutex_destroy

Definition at line 122 of file threads.h.

#define SCMutexInit (   mut,
  mutattr 
)    pthread_mutex_init(mut, mutattr)

Definition at line 118 of file threads.h.

#define SCMutexLock (   mut)    pthread_mutex_lock(mut)

Definition at line 119 of file threads.h.

#define SCMutexTrylock (   mut)    pthread_mutex_trylock(mut)

Definition at line 120 of file threads.h.

#define SCMutexUnlock (   mut)    pthread_mutex_unlock(mut)

Definition at line 121 of file threads.h.

#define SCRWLock   pthread_rwlock_t

Definition at line 126 of file threads.h.

#define SCRWLockDestroy   pthread_rwlock_destroy

Definition at line 133 of file threads.h.

#define SCRWLockInit (   rwl,
  rwlattr 
)    pthread_rwlock_init(rwl, rwlattr)

Definition at line 127 of file threads.h.

#define SCRWLockRDLock (   rwl)    pthread_rwlock_rdlock(rwl)

Definition at line 129 of file threads.h.

#define SCRWLockTryRDLock (   rwl)    pthread_rwlock_tryrdlock(rwl)

Definition at line 131 of file threads.h.

#define SCRWLockTryWRLock (   rwl)    pthread_rwlock_trywrlock(rwl)

Definition at line 130 of file threads.h.

#define SCRWLockUnlock (   rwl)    pthread_rwlock_unlock(rwl)

Definition at line 132 of file threads.h.

#define SCRWLockWRLock (   rwl)    pthread_rwlock_wrlock(rwl)

Definition at line 128 of file threads.h.

#define SCSetThreadName (   n)    (0)

Definition at line 301 of file threads.h.

Referenced by main(), StatsSetUI64(), and TmThreadsSlotVarRun().

#define SCSpinDestroy (   spin)    SCMutexDestroy((spin))

Definition at line 166 of file threads.h.

#define SCSpinInit (   spin,
  spin_attr 
)    SCMutexInit((spin), NULL)

Definition at line 165 of file threads.h.

#define SCSpinlock   SCMutex

Definition at line 161 of file threads.h.

#define SCSpinLock (   spin)    SCMutexLock((spin))

Definition at line 162 of file threads.h.

#define SCSpinTrylock (   spin)    SCMutexTrylock((spin))

Definition at line 163 of file threads.h.

#define SCSpinUnlock (   spin)    SCMutexUnlock((spin))

Definition at line 164 of file threads.h.

Enumeration Type Documentation

anonymous enum
Enumerator
PRIO_LOW 
PRIO_MEDIUM 
PRIO_HIGH 

Definition at line 85 of file threads.h.

Function Documentation

void ThreadMacrosRegisterTests ( void  )

this function registers unit tests for DetectId

Definition at line 144 of file threads.c.

References UtRegisterTest().

Here is the call graph for this function: