redesign semaphore, more easy understand