30 if (deque->
list == NULL) {
34 if (pthread_spin_init(&deque->
spinlock, PTHREAD_PROCESS_PRIVATE) != 0) {
58 if (pthread_spin_destroy(&deque->
spinlock) != 0)
83 pthread_spin_unlock(&deque->
spinlock);
102 pthread_spin_lock(&deque->
spinlock);
104 pthread_spin_unlock(&deque->
spinlock);
120 if (deque == NULL || data == NULL)
123 pthread_spin_lock(&deque->
spinlock);
126 pthread_spin_unlock(&deque->
spinlock);
142 if (deque == NULL || data == NULL)
145 pthread_spin_lock(&deque->
spinlock);
148 pthread_spin_unlock(&deque->
spinlock);
166 if (deque == NULL || node == NULL)
169 pthread_spin_lock(&deque->
spinlock);
171 pthread_spin_unlock(&deque->
spinlock);
176 pthread_spin_unlock(&deque->
spinlock);
194 pthread_spin_lock(&deque->
spinlock);
195 int size = deque->
size;
196 pthread_spin_unlock(&deque->
spinlock);
icl_node_t * icl_deque_append(icl_deque_t *deque, void *data)
Insert the node at the end of the deque.
icl_list_t * icl_list_prepend(icl_list_t *head, void *data)
Insert a node at the beginning of this list.
icl_list_t * icl_list_new()
Create new linked list.
icl_deque_t * icl_deque_new()
deque constructor
int icl_deque_size(icl_deque_t *deque)
Return the deque size.
int icl_list_destroy(icl_list_t *head, void(*free_function)(void *))
Frees the resources associated with this linked list.
icl_node_t * icl_deque_next(icl_deque_t *deque, icl_node_t *node)
Get the next node in the deque.
icl_node_t * icl_deque_first(icl_deque_t *deque)
Get the first node in the deque.
icl_list_t * icl_list_append(icl_list_t *head, void *data)
Insert a node at the end of this list.
icl_list_t * icl_list_first(icl_list_t *head)
Get the first item in this linked list.
int icl_deque_destroy(icl_deque_t *deque, void(*free_func)(void *))
deque destructor
int icl_deque_delete(icl_deque_t *deque, icl_node_t *node, void(*free_func)(void *))
Delete the node from the deque.
int icl_list_delete(icl_list_t *head, icl_list_t *pos, void(*free_function)(void *))
Delete the specified node.
pthread_spinlock_t spinlock
icl_node_t * icl_deque_prepend(icl_deque_t *deque, void *data)
Insert the node at the front of the deque.
icl_list_t * icl_list_next(icl_list_t *head, icl_list_t *pos)
Get the node following the specified node.