in ThreadPool::runNextJob(), a pointer to a ThreadPool is cleared before the job stops.
job->pool = 0;
job->shouldStop = true;
jobs.removeValue (job);
but it isn’t cleared in ThreadPool::removeJob() and ThreadPool::removeAllJobs().
So when trying to reuse ThreadPoolJob instance removed from a ThreadPool, ThreadPool::addJob() refuses it because it has a non-zero pointer of a ThreadPool.
jassert (job != 0);
jassert (job->pool == 0);
if (job->pool == 0)
{
// add job to pool
}
Reusing ThreadPoolJob instances is not recommended? But I want to do because pause/resume of ThreadPool jobs are needed.