work on ThrottleSemaphore. modified Semaphore to use Long instead of Int