producer consumer Semaphore version

changed from BlockingQ