do not respawn cancelled threads if we are shutting down
This commit is contained in:
@@ -84,7 +84,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->mutex->lock(this->mutex);
|
||||||
this->total_threads--;
|
this->total_threads--;
|
||||||
|
|||||||
Reference in New Issue
Block a user