Exemple #1
0
static void EsifDataLogExit(esif_thread_t *dataLogThread)
{
	g_dataLogQuit = ESIF_TRUE;
	esif_ccb_event_set(&g_dataLogQuitEvent);

	esif_ccb_thread_join(dataLogThread);
	esif_ccb_event_uninit(&g_dataLogQuitEvent);
}
Exemple #2
0
static enum esif_rc esif_ccb_timer_kill_w_event(
	esif_ccb_timer_t *timer_ptr,
	esif_ccb_event_t *event_ptr
	)
{
	enum esif_rc rc = ESIF_E_UNSPECIFIED;
	struct esif_tmrm_item *tmrm_item_ptr = NULL;
	struct esif_link_list_node *node_ptr = NULL;

	if (NULL == timer_ptr) {
		rc = ESIF_E_PARAMETER_IS_NULL;
		goto exit;
	}

	if (!g_tmrm.enabled)
		goto exit;

	esif_ccb_write_lock(&g_tmrm.mgr_lock);

	node_ptr = esif_ccb_tmrm_find_timer_node_wlock(timer_ptr->timer_handle);
	if ((NULL == node_ptr) || (NULL == node_ptr->data_ptr)) {
		rc = ESIF_E_INVALID_HANDLE;
		goto lock_exit;
	}

	tmrm_item_ptr = (struct esif_tmrm_item *)node_ptr->data_ptr;

	/* Mark for delete in case it is in the callback */
	tmrm_item_ptr->marked_for_delete = ESIF_TRUE;

	esif_ccb_tmrm_add_destroy_event(tmrm_item_ptr, event_ptr);

	/* If not in callback, the timer can be destroyed now */
	if (!tmrm_item_ptr->is_in_cb) {
		esif_ccb_tmrm_destroy_timer_node_wlock(node_ptr);
	}
	rc = ESIF_OK;
lock_exit:
	esif_ccb_write_unlock(&g_tmrm.mgr_lock);
exit:
	if ((rc != ESIF_OK) && (event_ptr != NULL)) {
		esif_ccb_event_set(event_ptr);
	}

	return rc;
}
Exemple #3
0
/*
 * Releases a reference on an action object.  This function should be
 * called when done using an action pointer obtained through any of the
 * Action Manager interfaces.
 */
void EsifAct_PutRef(EsifActPtr self)
{
	UInt8 needRelease = ESIF_FALSE;

	if (self != NULL) {
		esif_ccb_write_lock(&self->objLock);

		self->refCount--;

		if ((self->refCount == 0) && (self->markedForDelete)) {
			needRelease = ESIF_TRUE;
		}

		esif_ccb_write_unlock(&self->objLock);

		if (needRelease == ESIF_TRUE) {
			ESIF_TRACE_DEBUG("Signal delete event\n");
			esif_ccb_event_set(&self->deleteEvent);
		}
	}
}
Exemple #4
0
static void esif_ccb_tmrm_signal_waiters(
	void *data_ptr
	)
{
	esif_ccb_event_set((esif_ccb_event_t *)data_ptr);
}