ReadWriteLock held by "Thread[null]"?

I have what appears to be a deadlock in my application, but the thread dumps don't indicate where it is.

There is a data structure that uses a ReentrantReadWriteLock, and readers get the read lock, while writers get the write lock.

When the problem occurs, it looks as though two threads are waiting for the readLock, implying that some other thread is holding the WriteLock. However, I can't find that thread (if it exists).

The stack dump for the relevant threads looks like this:

Thread[State Update Dispatch] - WAITING

Waiting for: java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync@5b6d00

Held by: Thread[null]

Thread[State Update Log] - WAITING

Waiting for: java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync@5b6d00

Held by: Thread[null]

Both of these are waiting on a lock supposedly held by "Thread[null]", but there is no listing of any thread with a null name. I also cannot find any thread that appears to be in code that holds the write lock.

Questions:

1. Is a thread labelled "Thread[null]" some kind of special thread, or just a thread explicitly created with a null name?

2. Is it possible to misuse ReentrantReadWrite lock in such a way that two threads simultaneously calling for the readLock can lock each other out?

any feedback would be appreciated

Thanks,

Pat

[1408 byte] By [preaneya] at [2007-11-27 10:59:16]
# 1

Could it be possible that somewhere in your code you enter a lock but you do not release it correctly in a final block ? In that case one could expect that a thread stops running but still holds the lock and therefor the dump says Held by: Thread[null].

DikkeDouwea at 2007-7-29 12:21:54 > top of Java-index,Core,Core APIs...