Can you wrap the mutexes and conditionals in classes that output debugging information (e.g. "locked", "unlocked", etc.)? That might be a useful permanent solution for future debugging, as well. I'm not familiar with threads in Java, but in POSIX C you have access to a unique thread identifier within the thread, which can be output for tracking purposes.
Kevin Barry
|