fixed bug in signal when semaphores are same for source and target