Centralized thread cancellation in processor_t
This ensures that no threads are active when plugins and the rest of the daemon are unloaded. callback_job_t was simplified a lot in the process as its main functionality is now contained in processor_t. The parent-child relationships were abandoned as these were only needed to simplify job cancellation.
This commit is contained in:
@@ -113,6 +113,10 @@ static void destroy(private_daemon_t *this)
|
||||
{
|
||||
this->public.sender->flush(this->public.sender);
|
||||
}
|
||||
|
||||
/* cancel all threads and wait for their termination */
|
||||
lib->processor->cancel(lib->processor);
|
||||
|
||||
DESTROY_IF(this->public.receiver);
|
||||
#ifdef ME
|
||||
DESTROY_IF(this->public.connect_manager);
|
||||
@@ -120,7 +124,6 @@ static void destroy(private_daemon_t *this)
|
||||
#endif /* ME */
|
||||
/* make sure the cache is clear before unloading plugins */
|
||||
lib->credmgr->flush_cache(lib->credmgr, CERT_ANY);
|
||||
/* unload plugins to release threads */
|
||||
lib->plugins->unload(lib->plugins);
|
||||
#ifdef CAPABILITIES_LIBCAP
|
||||
cap_free(this->caps);
|
||||
|
||||
Reference in New Issue
Block a user