I have synchronized block. inside the block,calling a method which creates a pdf document. The problem is the thread which calls this method is waiting for a long time causing other threads to hung. how can i prevent this? Can i do some sort of timer so that if one thread is taking long time to return from the method,we can interrupt that thread and continue with other threads. Please give me a solution.