semaphore operations
use semaphore before move