Closed elliotgoodrich closed 9 years ago
on an object that has already been destructed
…or is being destroyed, which may be a lengthy operation — e.g. if an enqueued task tries to enqueue more.
You're right. I had not considered threads holding references to the pool itself!
Thanks for getting back to me quickly.
Thanks for getting back to me quickly.
@elliotgoodrich oh, I'm just another user of ThreadPool like you, sorry for not making that clear.
The variable stop is only set to true in the destructor. So the only way the if statement will be executed is if you are calling enqueue on an object that has already been destructed, which is undefined behaviour