renamed some IKEv2 OpenSSL scenarios
[strongswan.git] / src / charon / processing / processor.c
index a5f1833..eb1db33 100644 (file)
@@ -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.
  * 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 <stdlib.h>
  */
  
 #include <stdlib.h>
@@ -84,7 +82,9 @@ static void restart(private_processor_t *this)
 {
        pthread_t thread;
        
 {
        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--;
        {
                this->mutex->lock(this->mutex);
                this->total_threads--;