Looks like it is the semaphore which is causing the problems.