About Question enthuware.ocpjp.ii.v11.2.1574 :
Posted: Mon Mar 29, 2021 2:21 pm
The question is quite confusing especially when you don't see number of answers.
It asks:
It asks:
And third option formally avoids deadlock:Which of the following options avoids a deadlock?
Should I expect such questions from Oracle regarding concurrency?The second thread should call getLocks() only after first thread exits out of it.
This is not necessary. Option 2 works just fine.