I have the following code which execute a DB call within a reentrant lock. This code is executed by a thread pool (ExecutorService). As my knowledge this scenario is a blocking I/O operation. But I'm confused about the thread state while it executing the DB call and returning the result. Some says it's in a blocking state, some says it's in a waiting state with a monitor(But I think thread release the monitor when it's in waiting state). Need a clarification on this.
@Override
public void run() {
lock.lock();
try {
// DB call
} finally {
lock.unlock();
}
}