<p>Is it possible at runtime to programmatically check the name of the Thread that is holding the lock of a given object?</p>

You can only tell whether the current thread holds a normal lock (
```
Thread.holdsLock(Object)
```
). You can't get a reference to the thread that has the lock without native code.
However, if you're doing anything complicated with threading, you probably want to familiarize yourself with the java.util.concurrent packages. The
```
ReentrantLock
```
does allow you to get its owner (but its a protected method, so you'd have to extend this). Depending on your application, it may well be that by using the concurrency packages, you'll find that you don't need to get the lock's owner after all.
There are non-programmatic methods to find the lock owners, such as signaling the JVM to issue a thread dump to stderr, that are useful to determine the cause of deadlocks.