Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. class Account {
  2.   double balance;
  3.  
  4.   void withdraw(double amount){
  5.      balance -= amount;
  6.   }
  7.  
  8.   void deposit(double amount){
  9.      balance += amount;
  10.   }
  11.  
  12.    void transfer(Account from, Account to, double amount){
  13.         sync(from);
  14.         sync(to);
  15.  
  16.         from.withdraw(amount);
  17.         to.deposit(amount);
  18.  
  19.         release(to);
  20.         release(from);
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement