semaphore and delete lock
merged threadtest and test_lock