123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #ifndef ASIO_SYSTEM_CONTEXT_HPP
- #define ASIO_SYSTEM_CONTEXT_HPP
- #if defined(_MSC_VER) && (_MSC_VER >= 1200)
- # pragma once
- #endif
- #include "asio/detail/config.hpp"
- #include "asio/detail/scheduler.hpp"
- #include "asio/detail/thread_group.hpp"
- #include "asio/execution.hpp"
- #include "asio/execution_context.hpp"
- #include "asio/detail/push_options.hpp"
- namespace asio {
- template <typename Blocking, typename Relationship, typename Allocator>
- class basic_system_executor;
- class system_context : public execution_context
- {
- public:
-
- typedef basic_system_executor<
- execution::blocking_t::possibly_t,
- execution::relationship_t::fork_t,
- std::allocator<void>
- > executor_type;
-
- ASIO_DECL ~system_context();
-
- executor_type get_executor() noexcept;
-
- ASIO_DECL void stop();
-
- ASIO_DECL bool stopped() const noexcept;
-
- ASIO_DECL void join();
- #if defined(GENERATING_DOCUMENTATION)
- private:
- #endif
-
- ASIO_DECL system_context();
- private:
- template <typename, typename, typename> friend class basic_system_executor;
- struct thread_function;
-
- ASIO_DECL detail::scheduler& add_scheduler(detail::scheduler* s);
-
- detail::scheduler& scheduler_;
-
- detail::thread_group threads_;
-
- std::size_t num_threads_;
- };
- }
- #include "asio/detail/pop_options.hpp"
- #include "asio/impl/system_context.hpp"
- #if defined(ASIO_HEADER_ONLY)
- # include "asio/impl/system_context.ipp"
- #endif
- #endif
|