Solved

Class MyClass Has a Single ReentrantLock Object, MyLock

Question 12

Multiple Choice

Class MyClass has a single ReentrantLock object, myLock.Suppose thread one calls myLock.lock() as it enters methodX and immediately completes its CPU time slice.What will happen as thread two calls methodY and attempts to call myLock.lock() ?


A) Thread two will wait for the lock.
B) Thread two will acquire the lock.
C) Deadlock will occur.
D) Thread two causes the IllegalStateMonitorException.

Correct Answer:

verifed

Verified

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

Related Questions