Home | History | Annotate | Download | only in tml

Lines Matching refs:pQueue

50 ** Returns          (int) value of pQueue if successful
55 phDal4Nfc_message_queue_t* pQueue;
58 pQueue =
60 if (pQueue == NULL) return -1;
61 memset(pQueue, 0, sizeof(phDal4Nfc_message_queue_t));
62 if (pthread_mutex_init(&pQueue->nCriticalSectionMutex, NULL) == -1) {
63 free(pQueue);
66 if (sem_init(&pQueue->nProcessSemaphore, 0, 0) == -1) {
67 free(pQueue);
71 return ((intptr_t)pQueue);
86 phDal4Nfc_message_queue_t* pQueue = (phDal4Nfc_message_queue_t*)msqid;
88 if (pQueue != NULL) {
89 sem_post(&pQueue->nProcessSemaphore);
91 if (sem_destroy(&pQueue->nProcessSemaphore)) {
94 pthread_mutex_destroy(&pQueue->nCriticalSectionMutex);
96 free(pQueue);
117 phDal4Nfc_message_queue_t* pQueue;
123 pQueue = (phDal4Nfc_message_queue_t*)msqid;
124 pthread_mutex_lock(&pQueue->nCriticalSectionMutex);
125 if (pQueue->pItems != NULL) {
126 p = pQueue->pItems;
137 pQueue->pItems = NULL;
138 pthread_mutex_unlock(&pQueue->nCriticalSectionMutex);
139 pthread_mutex_destroy(&pQueue->nCriticalSectionMutex);
140 free(pQueue);
162 phDal4Nfc_message_queue_t* pQueue;
168 pQueue = (phDal4Nfc_message_queue_t*)msqid;
174 pthread_mutex_lock(&pQueue->nCriticalSectionMutex);
176 if (pQueue->pItems != NULL) {
177 p = pQueue->pItems;
184 pQueue->pItems = pNew;
186 pthread_mutex_unlock(&pQueue->nCriticalSectionMutex);
188 sem_post(&pQueue->nProcessSemaphore);
213 phDal4Nfc_message_queue_t* pQueue;
219 pQueue = (phDal4Nfc_message_queue_t*)msqid;
221 sem_wait(&pQueue->nProcessSemaphore);
223 pthread_mutex_lock(&pQueue->nCriticalSectionMutex);
225 if (pQueue->pItems != NULL) {
226 memcpy(msg, &(pQueue->pItems)->nMsg, sizeof(phLibNfc_Message_t));
227 p = pQueue->pItems->pNext;
228 free(pQueue->pItems);
229 pQueue->pItems = p;
231 pthread_mutex_unlock(&pQueue->nCriticalSectionMutex);