]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/example/cpp11/executors/bank_account_1.cpp
1 #include <boost/asio/execution.hpp>
2 #include <boost/asio/static_thread_pool.hpp>
5 using boost::asio::static_thread_pool
;
6 namespace execution
= boost::asio::execution
;
8 // Traditional active object pattern.
9 // Member functions do not block.
14 mutable static_thread_pool pool_
{1};
17 void deposit(int amount
)
27 void withdraw(int amount
)
33 if (balance_
>= amount
)
38 void print_balance() const
44 std::cout
<< "balance = " << balance_
<< "\n";