Motivation:
The thread performance checker warns that a threads with QoS are waiting
on threads in the NIOThreadPool. We can avoid these warnings by using a
condition variable instead.
Modifications:
- Replace the usage of a semaphore and lock in NIOThreadPool with a
condition lock.
- The condition value indicates whether the threads have work to do
(where work is processing work items or exiting their run loop).
Result:
- Fewer warnings
- Resolves#2960
(cherry picked from commit af0e612e8f)