Merge pull request #2582 from ludovic-henry/fix-threadpool-starvation