Ejemplo n.º 1
0
/* stop web server and wait for worker threads to exit */
void esif_ws_exit(esif_thread_t *threadPtr)
{
	CMD_OUT("Stopping WebServer...\n");
	atomic_set(&g_ws_quit, 1);
	esif_ccb_thread_join(threadPtr);  /* join to close child thread, clean up handle */
	// Wait for worker thread to finish
	while (atomic_read(&g_ws_threads) > 0) {
		esif_ccb_sleep(1);
	}
	esif_ccb_mutex_uninit(&g_web_socket_lock);
	atomic_set(&g_ws_quit, 0);
	CMD_OUT("WebServer Stopped\n");
}
Ejemplo n.º 2
0
void esif_uf_exit()
{
	/* Stop event thread */
	g_quit = ESIF_TRUE;

	/* Stop web server if it is running */
	EsifWebStop();
	EsifDataLogStop();
	EsifUFPollStop();

	/* Stop all Apps before dependent components they may be using */
	EsifAppMgrExit();

	/* OS Specific */
	esif_uf_os_exit();

	/* OS Agnostic - Call in reverse order of Init */
	EsifUpPm_Exit();
	EsifActMgrExit();
	EsifDspMgrExit();
	EsifEventMgr_Exit();
	EsifCnjMgrExit();
	EsifCfgMgrExit();
	EsifLogMgrExit();
	esif_ccb_tmrm_exit();
	esif_ht_exit();
	esif_link_list_exit();
	esif_ccb_mempool_uninit_tracking();

	// Re-Initialize necessary global variables in case ESIF restarted
	g_esif_started = ESIF_FALSE;

	ESIF_TRACE_DEBUG("Exit Upper Framework (UF)");


#ifdef ESIF_ATTR_SHELL_LOCK
	esif_ccb_mutex_uninit(&g_shellLock);
#endif
	ESIF_TRACE_EXIT_INFO();
}