I was thinking that we need to prevent changes to `taskQueue` while the transfer thread is in the process of stopping. So anything that adds elements to the queue would have to synchronize on the new lock as well (addTransfer is probably a better example here than restartBrokenTransfers.)