]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Make Networking TS work without gthreads [PR 89760]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 11 Aug 2020 15:16:22 +0000 (16:16 +0100)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 18:08:00 +0000 (15:08 -0300)
commit57190b082928638485b0a2f59d72004bf9f59b44
tree012e97fbfc87e6af2f904c517d207e4c86ffc4e0
parent3c2caa2c30e9db96cd4fdf096c3bd6f5af9db90a
libstdc++: Make Networking TS work without gthreads [PR 89760]

Make the experimental Networking TS code work without std::mutex and
std::condition_variable.

libstdc++-v3/ChangeLog:

PR libstdc++/89760
* include/experimental/executor [!_GLIBCXX_HAS_GTHREADS]:
(execution_context::mutex_type): Define dummy mutex type.
(system_context): Use execution_context::mutex_type.
(system_context) [!_GLIBCXX_HAS_GTHREADS]: Define dummy
thread and condition variable types.
[!_GLIBCXX_HAS_GTHREADS] (system_context::_M_run()): Do not
define.
(system_context::_M_post) [!_GLIBCXX_HAS_GTHREADS]: Throw
an exception when threads aren't available.
(strand::running_in_this_thread()): Defer to _M_state.
(strand::_State::running_in_this_thread()): New function.
(use_future_t): Do not depend on _GLIBCXX_USE_C99_STDINT_TR1.
* include/experimental/io_context (io_context): Use the
execution_context::mutex_type alias. Replace stack of thread
IDs with counter.
* testsuite/experimental/net/execution_context/use_service.cc:
Enable test for non-pthread targets.
libstdc++-v3/include/experimental/executor
libstdc++-v3/include/experimental/io_context
libstdc++-v3/testsuite/experimental/net/execution_context/use_service.cc