Use Semaphore to avoid the internal queues grow infinitely.