Lines Matching refs:pList
42 int listInit(struct listHead* pList) {
43 pList->pFirst = NULL;
44 if (pthread_mutex_init(&pList->mutex, NULL) == -1) {
61 int listDestroy(struct listHead* pList) {
64 bListNotEmpty = listGetAndRemoveNext(pList, NULL);
67 if (pthread_mutex_destroy(&pList->mutex) == -1) {
84 int listAdd(struct listHead* pList, void* pData) {
99 pthread_mutex_lock(&pList->mutex);
102 if (pList->pFirst == NULL) {
104 pList->pFirst = pNode;
107 pLastNode = pList->pFirst;
119 pthread_mutex_unlock(&pList->mutex);
132 int listRemove(struct listHead* pList, void* pData) {
137 pthread_mutex_lock(&pList->mutex);
139 if (pList->pFirst == NULL) {
146 pNode = pList->pFirst;
147 if (pList->pFirst->pData == pData) {
152 pList->pFirst = pList->pFirst->pNext;
182 pthread_mutex_unlock(&pList->mutex);
195 int listGetAndRemoveNext(struct listHead* pList, void** ppData) {
199 pthread_mutex_lock(&pList->mutex);
201 if (pList->pFirst == NULL) {
209 pNode = pList->pFirst;
217 pList->pFirst = pNode->pNext;
223 listDump(pList);
224 pthread_mutex_unlock(&pList->mutex);
237 void listDump(struct listHead* pList) {
238 struct listNode* pNode = pList->pFirst;