diff --git a/CMakeLists.txt b/CMakeLists.txt index f70c3db8..a2ffe56b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,13 +125,10 @@ else() if (NOT BOOST_COBALT_BUILD_INLINE) find_package(Threads REQUIRED) # Boost 1.82 is the first with a Boost.ASIO with necessary support - find_package(Boost 1.82 REQUIRED COMPONENTS system OPTIONAL_COMPONENTS json context url) + find_package(Boost REQUIRED COMPONENTS system OPTIONAL_COMPONENTS json context url) if (BOOST_COBALT_USE_BOOST_CONTAINER) find_package(Boost REQUIRED container) endif() - if (BOOST_COBALT_BUILD_TESTS) - find_package(Boost REQUIRED unit_test_framework) - endif() include_directories(include) endif() diff --git a/include/boost/cobalt/detail/gather.hpp b/include/boost/cobalt/detail/gather.hpp index b53844ea..c1d64078 100644 --- a/include/boost/cobalt/detail/gather.hpp +++ b/include/boost/cobalt/detail/gather.hpp @@ -187,6 +187,9 @@ struct gather_variadic_impl template using result_part = system::result, std::exception_ptr>; +#if _MSC_VER + BOOST_NOINLINE +#endif std::tuple ...> await_resume() { return mp11::tuple_transform( @@ -379,6 +382,9 @@ struct gather_ranged_impl return true; } +#if _MSC_VER + BOOST_NOINLINE +#endif auto await_resume() { #if !defined(BOOST_COBALT_NO_PMR) diff --git a/include/boost/cobalt/detail/join.hpp b/include/boost/cobalt/detail/join.hpp index 4f07a7a9..d96d5471 100644 --- a/include/boost/cobalt/detail/join.hpp +++ b/include/boost/cobalt/detail/join.hpp @@ -217,6 +217,9 @@ struct join_variadic_impl return true; } +#if _MSC_VER + BOOST_NOINLINE +#endif auto await_resume() { if (error) @@ -510,6 +513,9 @@ struct join_ranged_impl } } +#if _MSC_VER + BOOST_NOINLINE +#endif auto await_resume() { if (error) diff --git a/include/boost/cobalt/detail/race.hpp b/include/boost/cobalt/detail/race.hpp index 8f5f162b..72eb6eb9 100644 --- a/include/boost/cobalt/detail/race.hpp +++ b/include/boost/cobalt/detail/race.hpp @@ -337,6 +337,9 @@ struct race_variadic_impl return true; } +#if _MSC_VER + BOOST_NOINLINE +#endif auto await_resume() { if (error) @@ -644,6 +647,9 @@ struct race_ranged_impl return true; } +#if _MSC_VER + BOOST_NOINLINE +#endif auto await_resume() { if (error) diff --git a/include/boost/cobalt/thread.hpp b/include/boost/cobalt/thread.hpp index cc40dadb..1b172b87 100644 --- a/include/boost/cobalt/thread.hpp +++ b/include/boost/cobalt/thread.hpp @@ -83,13 +83,6 @@ void thread::cancel(asio::cancellation_type type) }); } -inline void thread::join() {thread_.join();} -inline bool thread::joinable() const {return thread_.joinable();} -inline void thread::detach() -{ - thread_.detach(); - state_ = nullptr; -} inline auto thread::operator co_await() &-> detail::thread_awaitable diff --git a/src/thread.cpp b/src/thread.cpp index 3d6273d9..8f3a2e54 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -11,7 +11,10 @@ #include -namespace boost::cobalt::detail +namespace boost::cobalt +{ + +namespace detail { thread_promise::thread_promise() @@ -78,7 +81,16 @@ boost::cobalt::thread detail::thread_promise::get_return_object() }; return res; - } +} } + +void thread::join() {thread_.join();} +bool thread::joinable() const {return thread_.joinable();} +void thread::detach() +{ + thread_.detach(); + state_ = nullptr; +} +} \ No newline at end of file