My instructions say the following about the lock method:
'the current
thread gives up the CPU and consumes no CPU cycles until the record is unlocked'
Using your method, the current thread gives up the CPU and consumes no CPU cycles until 10 seconds have passed or the record is unlocked.
I would not risk auto-failure here, especially as there are other ways to deal with deadlocks.
And I think it is bad design to throw an unchecked exception for this. Please read up on the difference between runtime and checked exceptions to understand why.