deadlock on synchronized ( String intern())
I user sun jdk 1.5 ThreadPoolExecutor( 24, 24,60,TimeUnit.SECONDS, new LinkedBlockingQueue()). soemtime I use jdb tool to find the status of all threads in thread pool are " waiting in a monitor", the code is : String key = getKey(dt.getPrefix(), id); synchronized (key.intern()) { -----> Is there a problem in "synchronized (key.intern()) " ? I get following informatnio using jdb tool, the status of 24 threads is "waiting in a monitor", it means 24 threads are deadlock at "key.intern()". (java.lang.Thread)0x28 pool-3-thread-2 waiting in a monitor (java.lang.Thread)0x27 pool-3-thread-3 waiting