One of the strategy to avoid deadlock situation in Java Multithreading is using timeout. Suppose, one thread has acquired lock on one resource and now waiting for lock on another resource. After certain time period if it can not acquire lock on resource 2 then it should stop waiting for lock on resource 2. Also it should release lock on resource 1. Thus deadlocks will be avoided.
so ans is A