]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/example/cpp14/executors/bank_account_2.cpp
1 #include <boost/asio/ts/executor.hpp>
2 #include <boost/asio/thread_pool.hpp>
5 using boost::asio::post
;
6 using boost::asio::thread_pool
;
7 using boost::asio::use_future
;
9 // Traditional active object pattern.
10 // Member functions block until operation is finished.
15 mutable thread_pool pool_
{1};
18 void deposit(int amount
)
27 void withdraw(int amount
)
32 if (balance_
>= amount
)
52 std::cout
<< "balance = " << acct
.balance() << "\n";