ThreadPool - Passing a Job using a Lambda

I noticed that if you use a lambda function as a job, passing it to the addJob() method of the ThreadPool class, then a struct wraps the job overriding the jobNeedsRunningAgain return that you may have put in your job, forcing it to jobHasFinished. So, if you think that your job will be run again, it won’t.
Am I right?
If so, it could be helpful to specify this behaviour in the documentation.
Thanks

There are two overloads of addJob, one which accepts a lambda returning a JobStatus, and one which accepts a lambda returning void. If the lambda passed to addJob returns a status, then the first overload should be selected, and the job should re-run correctly if requested.

2 Likes