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:
Verified
Q66: Under what conditions are locks unnecessary for
Q67: Assume three threads share a BankAccount object
Q68: What happens when a thread calls the
Q69: lock objects ensure that shared data are
Q70: Why does the textbook recommend signallAll over
Q72: Consider an old fashioned telephone booth that
Q73: Class MyClass has two ReentrantLock objects, myLock1
Q74: Assume two threads share a BankAccount object
Q75: Assume three threads share a BankAccount object
Q76: The term "stale data" refers to a
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents