void mainwindow(int argc, char **argv) { int init_result = init(argc, argv); if (init_result != 0) { fprintf(stderr, "Init was unsuccessful. Quitting '\n"); } glutMainLoop(); stop_thread_pool(); }
LIBDE265_API void de265_free_decoder(de265_decoder_context* de265ctx) { decoder_context* ctx = (decoder_context*)de265ctx; if (ctx->num_worker_threads>0) { flush_thread_pool(&ctx->thread_pool); stop_thread_pool(&ctx->thread_pool); } free_decoder_context(ctx); free(de265ctx); }
LIBDE265_API de265_error de265_free_decoder(de265_decoder_context* de265ctx) { decoder_context* ctx = (decoder_context*)de265ctx; if (ctx->num_worker_threads>0) { //flush_thread_pool(&ctx->thread_pool); stop_thread_pool(&ctx->thread_pool); } free_decoder_context(ctx); free(de265ctx); return de265_free(); }
LIBDE265_API void de265_reset(de265_decoder_context* de265ctx) { decoder_context* ctx = (decoder_context*)de265ctx; int num_worker_threads = ctx->num_worker_threads; if (num_worker_threads>0) { //flush_thread_pool(&ctx->thread_pool); stop_thread_pool(&ctx->thread_pool); } // TODO: maybe we can do things better here free_decoder_context(ctx); init_decoder_context(ctx); if (num_worker_threads>0) { // TODO: need error checking de265_start_worker_threads(de265ctx, num_worker_threads); } }
/** * Stop all nuauth thread pools * If soft is true, destroy pools. */ void stop_all_thread_pools(gboolean soft) { /* end logging threads */ if (soft) { stop_thread_pool("session logger", &nuauthdatas->user_session_loggers); stop_thread_pool("packet logger", &nuauthdatas->user_loggers); stop_thread_pool("acl checker", &nuauthdatas->acl_checkers); stop_thread_pool("users workers", &nuauthdatas->user_workers); if (nuauthconf->log_users_sync) { stop_thread_pool("decision worker", &nuauthdatas->decisions_workers); } if (nuauthconf->do_ip_authentication) { stop_thread_pool("ip auth worker", &nuauthdatas->ip_authentication_workers); } } g_thread_pool_stop_unused_threads(); }
ThreadPool::~ThreadPool() { stop_thread_pool(); }