I did think about it, but I was hesitating because the single lock seemed simpler conceptually.

Finally, I bit the bullet, and I changed `isTransferThreadRunning` to an AtomicBoolean, with the possibility of reviving the thread if someone else added a task.