Part 95 Deadlock in a multithreaded program