counting semaphore using Test&Set