Lines Matching defs:pQueue

52 ** Returns          (int) value of pQueue if successful
58 phDal4Nfc_message_queue_t * pQueue;
61 pQueue = (phDal4Nfc_message_queue_t *) malloc(sizeof(phDal4Nfc_message_queue_t));
62 if (pQueue == NULL)
64 memset(pQueue, 0, sizeof(phDal4Nfc_message_queue_t));
65 if (pthread_mutex_init(&pQueue->nCriticalSectionMutex, NULL) == -1)
67 free (pQueue);
70 if (sem_init(&pQueue->nProcessSemaphore, 0, 0) == -1)
72 free (pQueue);
76 return ((intptr_t) pQueue);
92 phDal4Nfc_message_queue_t * pQueue = (phDal4Nfc_message_queue_t*)msqid;
94 if(pQueue != NULL)
96 sem_post(&pQueue->nProcessSemaphore);
98 if (sem_destroy(&pQueue->nProcessSemaphore))
102 pthread_mutex_destroy (&pQueue->nCriticalSectionMutex);
104 free(pQueue);
125 phDal4Nfc_message_queue_t * pQueue;
132 pQueue = (phDal4Nfc_message_queue_t *) msqid;
133 pthread_mutex_lock(&pQueue->nCriticalSectionMutex);
134 if (pQueue->pItems != NULL)
136 p = pQueue->pItems;
149 pQueue->pItems = NULL;
150 pthread_mutex_unlock(&pQueue->nCriticalSectionMutex);
151 pthread_mutex_destroy(&pQueue->nCriticalSectionMutex);
152 free(pQueue);
175 phDal4Nfc_message_queue_t * pQueue;
183 pQueue = (phDal4Nfc_message_queue_t *) msqid;
189 pthread_mutex_lock(&pQueue->nCriticalSectionMutex);
191 if (pQueue->pItems != NULL)
193 p = pQueue->pItems;
203 pQueue->pItems = pNew;
205 pthread_mutex_unlock(&pQueue->nCriticalSectionMutex);
207 sem_post(&pQueue->nProcessSemaphore);
232 phDal4Nfc_message_queue_t * pQueue;
239 pQueue = (phDal4Nfc_message_queue_t *) msqid;
241 sem_wait(&pQueue->nProcessSemaphore);
243 pthread_mutex_lock(&pQueue->nCriticalSectionMutex);
245 if (pQueue->pItems != NULL)
247 memcpy(msg, &(pQueue->pItems)->nMsg, sizeof(phLibNfc_Message_t));
248 p = pQueue->pItems->pNext;
249 free(pQueue->pItems);
250 pQueue->pItems = p;
252 pthread_mutex_unlock(&pQueue->nCriticalSectionMutex);