diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-06-19 13:29:09 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-06-25 17:38:59 +0200 |
commit | 26d77eb3e61b2ff929dff96bbb53a5d22d76ce4f (patch) | |
tree | 5d5b7bd7bb2cd6a721c65b82f8ce2a8b3f4fdf22 /src/libcharon/plugins/duplicheck/duplicheck_notify.c | |
parent | 7fec83af28f233a02b7ae08c6fd4de65799cb6b4 (diff) | |
download | strongswan-26d77eb3e61b2ff929dff96bbb53a5d22d76ce4f.tar.bz2 strongswan-26d77eb3e61b2ff929dff96bbb53a5d22d76ce4f.tar.xz |
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.
Diffstat (limited to 'src/libcharon/plugins/duplicheck/duplicheck_notify.c')
-rw-r--r-- | src/libcharon/plugins/duplicheck/duplicheck_notify.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/libcharon/plugins/duplicheck/duplicheck_notify.c b/src/libcharon/plugins/duplicheck/duplicheck_notify.c index b86f1ef3d..3da640efe 100644 --- a/src/libcharon/plugins/duplicheck/duplicheck_notify.c +++ b/src/libcharon/plugins/duplicheck/duplicheck_notify.c @@ -43,11 +43,6 @@ struct private_duplicheck_notify_t { duplicheck_notify_t public; /** - * Callback job dispatching connections - */ - callback_job_t *job; - - /** * Mutex to lock list */ mutex_t *mutex; @@ -167,10 +162,6 @@ METHOD(duplicheck_notify_t, destroy, void, enumerator_t *enumerator; uintptr_t fd; - if (this->job) - { - this->job->cancel(this->job); - } enumerator = this->connected->create_enumerator(this->connected); while (enumerator->enumerate(enumerator, &fd)) { @@ -203,9 +194,9 @@ duplicheck_notify_t *duplicheck_notify_create() destroy(this); return NULL; } - this->job = callback_job_create_with_prio((callback_job_cb_t)receive, - this, NULL, NULL, JOB_PRIO_CRITICAL); - lib->processor->queue_job(lib->processor, (job_t*)this->job); + lib->processor->queue_job(lib->processor, + (job_t*)callback_job_create_with_prio((callback_job_cb_t)receive, this, + NULL, (callback_job_cancel_t)return_false, JOB_PRIO_CRITICAL)); return &this->public; } |