das ist das (bisher) naheliegende Modell:
class Account { int balance;
synchronized void withdraw (int m)
{ balance -= m; }
synchronized void deposit (int m)
{ withdraw (-m); }
welche Fehler können hier passieren:
void transfer
(Account from, Account to, int m)
{
from.withdraw (m);
to.deposit (m);
}