Minor optimizations
Generalized semaphores, to accept count for take and give