/* Thread: main */ void library_deinit() { int i; int ret; scan_exit = true; commands_base_destroy(cmdbase); ret = pthread_join(tid_library, NULL); if (ret != 0) { DPRINTF(E_FATAL, L_LIB, "Could not join library thread: %s\n", strerror(errno)); return; } for (i = 0; sources[i]; i++) { if (sources[i]->deinit && !sources[i]->disabled) sources[i]->deinit(); } event_base_free(evbase_lib); }
void worker_deinit(void) { int ret; g_initialized = 0; commands_base_destroy(cmdbase); ret = pthread_join(tid_worker, NULL); if (ret != 0) { DPRINTF(E_FATAL, L_MAIN, "Could not join worker thread: %s\n", strerror(errno)); return; } // Free event base (should free events too) event_base_free(evbase_worker); }
/* Thread: main */ void filescanner_deinit(void) { int ret; scan_exit = 1; commands_base_destroy(cmdbase); ret = pthread_join(tid_scan, NULL); if (ret != 0) { DPRINTF(E_FATAL, L_SCAN, "Could not join filescanner thread: %s\n", strerror(errno)); return; } inofd_event_unset(); event_base_free(evbase_scan); }