Solved

Class MyClass Has Two ReentrantLock Objects, MyLock1 and MyLock2

Question 73

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents