change semaphore lock method