- cancelling of busy prime thread allowed
authorMartin Willi <martin@strongswan.org>
Tue, 6 Dec 2005 11:51:40 +0000 (11:51 -0000)
committerMartin Willi <martin@strongswan.org>
Tue, 6 Dec 2005 11:51:40 +0000 (11:51 -0000)
Source/charon/threads/prime_pool.c

index cee51d8..b5c8796 100644 (file)
@@ -301,6 +301,10 @@ void generate_primes(private_prime_pool_t *this)
                        selected_prime_list->primes->insert_last(selected_prime_list->primes, (void*)prime);
                        pthread_mutex_unlock(&(this->mutex));
                }
+               /* abort if requested */
+               pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+               pthread_testcancel();
+               pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
        }
 }