Go to the documentation of this file.
24 #ifndef __HOST_QUEUE_H__
25 #define __HOST_QUEUE_H__
36 #error Cannot enable both HQLOCK_SPIN and HQLOCK_MUTEX
51 #elif defined HQLOCK_SPIN
54 #error Enable HQLOCK_SPIN or HQLOCK_MUTEX
59 #define HQLOCK_INIT(q) SCSpinInit(&(q)->s, 0)
60 #define HQLOCK_DESTROY(q) SCSpinDestroy(&(q)->s)
61 #define HQLOCK_LOCK(q) SCSpinLock(&(q)->s)
62 #define HQLOCK_TRYLOCK(q) SCSpinTrylock(&(q)->s)
63 #define HQLOCK_UNLOCK(q) SCSpinUnlock(&(q)->s)
64 #elif defined HQLOCK_MUTEX
65 #define HQLOCK_INIT(q) SCMutexInit(&(q)->m, NULL)
66 #define HQLOCK_DESTROY(q) SCMutexDestroy(&(q)->m)
67 #define HQLOCK_LOCK(q) SCMutexLock(&(q)->m)
68 #define HQLOCK_TRYLOCK(q) SCMutexTrylock(&(q)->m)
69 #define HQLOCK_UNLOCK(q) SCMutexUnlock(&(q)->m)
71 #error Enable HQLOCK_SPIN or HQLOCK_MUTEX
HostQueue * HostQueueInit(HostQueue *)
uint32_t HostQueueLen(HostQueue *)
struct HostQueue_ HostQueue
HostQueue * HostQueueNew(void)
void HostEnqueue(HostQueue *, Host *)
add a host to a queue
Host * HostDequeue(HostQueue *)
remove a host from the queue
void HostQueueDestroy(HostQueue *)
Destroy a host queue.