but how would i implement a semaphore for that