Question
You are given a `BankAccount` whose `deposit` method performs a read-modify-write operation and may pause between reading and writing. You cannot modify that class. Implement a subclass that makes deposits safe when multiple threads call it concurrently.
```python
class SafeAccount(BankAccount):
def __init__(self, opening_balance): ...
def deposit(self, amount) -> None: ...
```
Call the inherited implementation rather than copying it. Two deposits of `500` and `700` into an account starting at `0` must finish with `1200`. Ensure the lock is released if the inherited method raises.
The supplied constructor creates the account and its lock. Complete `deposit` only. The provided `run_case` adapter owns the concurrent fixture execution; it is not candidate work. Opening balances and deposit amounts are integers, and deposit amounts are nonnegative. Empty deposit lists leave the opening balance unchanged. Each successful call returns `None`.
## Discussion follow-ups (not graded by the base fixtures)
1. Explain why protecting only the final assignment is insufficient.
2. Add withdrawals and transfers between two accounts without deadlock.
3. Decide when a reentrant lock is necessary.
4. Discuss why an in-process lock is insufficient across multiple service instances.