semaphore waiters comparison function