Пример #1
0
/* Removes a participant from each running application */
eEsifError EsifAppMgrDestroyParticipantInAllApps(const EsifUpPtr upPtr)
{
	eEsifError rc = ESIF_OK;
	EsifAppPtr app_ptr = NULL;
	UInt8 i;

	if (NULL == upPtr) {
		ESIF_TRACE_ERROR("The participant data pointer is NULL\n");
		rc = ESIF_E_PARAMETER_IS_NULL;
		goto exit;
	}

	esif_ccb_read_lock(&g_appMgr.fLock);

	for (i = 0; i < ESIF_MAX_APPS; i++) {
		app_ptr = &g_appMgr.fEntries[i];

		if (NULL != app_ptr->fHandle) {
			EsifAppDestroyParticipant(app_ptr, upPtr);
		}
	}

	esif_ccb_read_unlock(&g_appMgr.fLock);
exit:
	return rc;
}
Пример #2
0
eEsifError EsifUpManagerDestroyParticipantsInApp(EsifAppPtr aAppPtr)
{
	UInt8 i = 0;

	esif_ccb_read_lock(&g_uppMgr.fLock);

	for (i = 0; i < MAX_PARTICIPANT_ENTRY; i++) {
		EsifUpPtr up_ptr = g_uppMgr.fEntries[i].fUpPtr;
		if ((NULL != up_ptr) && (g_uppMgr.fEntries[i].fState > ESIF_PM_PARTICIPANT_REMOVED)) {
			EsifAppDestroyParticipant(aAppPtr, up_ptr);
		}
	}

	esif_ccb_read_unlock(&g_uppMgr.fLock);

	ESIF_TRACE_INFO("Destroy participants in App\n");
	return ESIF_OK;
}
Пример #3
0
static eEsifError EsifApp_DestroyParticipants(EsifAppPtr self)
{
	EsifUpPtr upPtr = NULL;
	UInt8 i = 0;

	ESIF_ASSERT(self != NULL);

	/* TODO:  Use iterator here.  This function shouldn't know the number of participants */
	for (i = 0; i < MAX_PARTICIPANT_ENTRY; i++) {
		upPtr = EsifUpPm_GetAvailableParticipantByInstance(i);
		if (NULL == upPtr) {
			continue;
		}
		EsifAppDestroyParticipant(self, upPtr);
		EsifUp_PutRef(upPtr);
	}

	ESIF_TRACE_INFO("Destroy participants in App\n");
	return ESIF_OK;
}