void nfc_cb_data_releaseAll() { nfc_jni_callback_data* pCallbackData; while (listGetAndRemoveNext(&nfc_jni_get_monitor()->sem_list, (void**)&pCallbackData)) { pCallbackData->status = NFCSTATUS_FAILED; sem_post(&pCallbackData->sem); } }
/******************************************************************************* ** ** Function phNxpNciHal_releaseall_cb_data ** ** Description Release all callback data ** ** Returns None ** *******************************************************************************/ void phNxpNciHal_releaseall_cb_data(void) { phNxpNciHal_Sem_t* pCallbackData; while (listGetAndRemoveNext(&phNxpNciHal_get_monitor()->sem_list, (void**) &pCallbackData)) { pCallbackData->status = NFCSTATUS_FAILED; sem_post(&pCallbackData->sem); } return; }
bool listDestroy(listHead* pList) { bool bListNotEmpty = true; while (bListNotEmpty) { bListNotEmpty = listGetAndRemoveNext(pList, NULL); } if(pthread_mutex_destroy(&pList->mutex) == -1) { ALOGE("Mutex destruction failed (errno=0x%08x)", errno); return false; } return true; }
/******************************************************************************* ** ** Function listDestroy ** ** Description List destruction ** ** Returns 1, if list destroyed, 0 if failed ** *******************************************************************************/ int listDestroy(struct listHead* pList) { int bListNotEmpty = 1; while (bListNotEmpty) { bListNotEmpty = listGetAndRemoveNext(pList, NULL); } if (pthread_mutex_destroy(&pList->mutex) == -1) { NXPLOG_NCIHAL_E("Mutex destruction failed (errno=0x%08x)", errno); return 0; } return 1; }