sem added to sleep and wake up thread