From d381f366088751f30923223917f0dddfa94f1865 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 6 Dec 2005 11:51:40 +0000 Subject: [PATCH] - cancelling of busy prime thread allowed --- Source/charon/threads/prime_pool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/charon/threads/prime_pool.c b/Source/charon/threads/prime_pool.c index cee51d8f7..b5c879677 100644 --- a/Source/charon/threads/prime_pool.c +++ b/Source/charon/threads/prime_pool.c @@ -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); } }