From a6f902baed7abb17a1a9c014e01bb100077f8198 Mon Sep 17 00:00:00 2001 From: Rene Mayrhofer Date: Sun, 1 Mar 2009 10:48:08 +0000 Subject: - Updated to new upstream revision. --- src/charon/processing/processor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/charon/processing/processor.c') diff --git a/src/charon/processing/processor.c b/src/charon/processing/processor.c index 9cff090bf..68916937b 100644 --- a/src/charon/processing/processor.c +++ b/src/charon/processing/processor.c @@ -13,7 +13,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * $Id: processor.c 4579 2008-11-05 11:29:56Z martin $ + * $Id: processor.c 4802 2008-12-12 15:57:12Z martin $ */ #include @@ -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--; -- cgit v1.2.3