aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2008-12-12 15:57:12 +0000
committerMartin Willi <martin@strongswan.org>2008-12-12 15:57:12 +0000
commit50901d255093b93390e7195ba31609f502288791 (patch)
tree21300a0e75e76cc7f9e2ac6a954f3c0c93acc593 /src
parent248a1f57bba0656c3ed02dfd7f9987027bdc1c99 (diff)
downloadstrongswan-50901d255093b93390e7195ba31609f502288791.tar.bz2
strongswan-50901d255093b93390e7195ba31609f502288791.tar.xz
do not respawn cancelled threads if we are shutting down
Diffstat (limited to 'src')
-rw-r--r--src/charon/processing/processor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/charon/processing/processor.c b/src/charon/processing/processor.c
index a5f1833c0..156c65b8e 100644
--- a/src/charon/processing/processor.c
+++ b/src/charon/processing/processor.c
@@ -84,7 +84,9 @@ static void restart(private_processor_t *this)
{
pthread_t thread;
- if (pthread_create(&thread, NULL, (void*)process_jobs, this) != 0)
+ /* respawn thread if required */
+ if (this->desired_threads == 0 ||
+ pthread_create(&thread, NULL, (void*)process_jobs, this) != 0)
{
this->mutex->lock(this->mutex);
this->total_threads--;