Hi Daniel,
I feel I don't have enough information to solve your problem. I'd probably have to see much more of your code or even run your program on my machine to figure it out.
But this is your assignment. Please try to figure out yourself where it is deadlocking (which line). Browse the web if you do not know how to debug your application.
I suppose adding a logger is one option, debug your application (step through it with your
IDE), press Ctrl-Break (Windows) in the command prompt to see what your threads are waiting for.
Good luck,
Dies