Solved

Class MyClass Has Two ReentrantLock Objects, MyLock1 and MyLock2

Question 49

Multiple Choice

Class MyClass has two ReentrantLock objects, myLock1 and myLock2.Suppose thread one acquires myLock1 as it enters methodX and immediately completes its CPU time slice.After thread two enters methodY, it acquires myLock2 and tries to acquire myLock1.When thread one resumes, it tries to acquire myLock2.What will happen next?


A) Thread two will acquire myLock1
B) Thread one will acquire myLock2
C) Deadlock will occur
D) Thread two will release myLock2

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions