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:
Tobias Brunner
2012-06-25 17:38:59 +02:00
parent 7fec83af28
commit 26d77eb3e6
31 changed files with 263 additions and 477 deletions
+4 -1
View File
@@ -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);