priority, semaphore implemented