counter semaphore initialised with variable