X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=blobdiff_plain;f=src%2Fcharon%2Fprocessing%2Fprocessor.c;h=eb1db331ba232694e50166f1850cc840497bfe27;hp=a5f1833c0a131e09bd6364c5836bc5b893cbb943;hb=a09d1c386af714974c69b5b9dc658cebfea3a886;hpb=3ac5a0db8ca620ab1eb536dbc742c3acf8325b98 diff --git a/src/charon/processing/processor.c b/src/charon/processing/processor.c index a5f1833..eb1db33 100644 --- a/src/charon/processing/processor.c +++ b/src/charon/processing/processor.c @@ -12,8 +12,6 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. - * - * $Id$ */ #include @@ -84,7 +82,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--;