Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Account {
- double balance;
- void withdraw(double amount){
- balance -= amount;
- }
- void deposit(double amount){
- balance += amount;
- }
- void transfer(Account from, Account to, double amount){
- sync(from);
- sync(to);
- from.withdraw(amount);
- to.deposit(amount);
- release(to);
- release(from);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement