• Home
  • Raw
  • Download

Lines Matching refs:pQueue

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