diff options
author | Martin Willi <martin@strongswan.org> | 2008-12-12 15:57:12 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2008-12-12 15:57:12 +0000 |
commit | 50901d255093b93390e7195ba31609f502288791 (patch) | |
tree | 21300a0e75e76cc7f9e2ac6a954f3c0c93acc593 /src | |
parent | 248a1f57bba0656c3ed02dfd7f9987027bdc1c99 (diff) | |
download | strongswan-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.c | 4 |
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--; |