2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-27 18:42:07 +00:00
Commit Graph

1075 Commits

Author SHA1 Message Date
Christopher Kohlhoff
53211fce62 Use _POSIX_VERSION to detect support for MSG_NOSIGNAL.
This flag for sendmsg(2) was standardised in POSIX.1-2008 so all systems
that support at least that version should have it. This prevents
unexpected SIGPIPEs on at least OpenBSD and possibly others.
MSG_NOSIGNAL is used unconditionally on Linux to match existing
behaviour and also because this was present on Linux long before
standardisation.
2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
f5e8ecdcba Allow using libpthread on Windows.
In some cases, using libpthread on Windows is desired, for example
when porting software that's already using libpthread, avoiding
mixing the two libraries, which can be troublesome.

This change will allow using libthread when targetting Windows and
BOOST_ASIO_HAS_PTHREADS is set.
2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
aba1c59418 Fix typo GENERATION_DOCUMENTATION 2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
c9a6942cd4 Qualify a call to this_ to satisfy clang on Windows.
Without this change, clang 10.0.0 (and at least as early as 8.0.0)
fails to compile asio on Windows.
2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
b2b0f19544 Reduce lock contention for cancel_timer.
Lock should not be held while executing post_deferred_completions.
The unlock call is present everywhere (in all implementations, including in this file) except in this function.
Lock contention has been observed via Windows Performance Analyzer:

ntdll.dll!RtlpWaitOnCriticalSection
ntdll.dll!RtlpEnterCriticalSectionContended
ntdll.dll!RtlEnterCriticalSection
IxServer.exe!boost::asio::detail::win_iocp_io_context::cancel_timer<boost::asio::detail::chrono_time_traits<boost::chrono::steady_clock,boost::asio::wait_traits<boost::chrono::steady_clock> > >
IxServer.exe!boost::asio::detail::deadline_timer_service<boost::asio::detail::chrono_time_traits<boost::chrono::steady_clock,boost::asio::wait_traits<boost::chrono::steady_clock> > >::expires_at
2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
553b805626 Fix any_executor support for BOOST_ASIO_NO_TYPEID (i.e. no RTTI). 2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
898f838331 Cast to void to fix comma-operator warning. 2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
616bff3f0f Remove redundant semicolons. 2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
4f7fd78953 Suppress zero-as-null-pointer-constant warnings. 2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
b1c6407e3d Add missing push/pop_options.hpp includes. 2020-11-02 12:24:13 +11:00
Christopher Kohlhoff
8e1d80d8b9 Fix (benign) switch fallthrough warning. 2020-11-02 12:23:57 +11:00
Christopher Kohlhoff
883e66e3c4 Fix "logical ‘or’ of equal expressions" warning on linux. 2020-11-02 12:23:45 +11:00
Christopher Kohlhoff
1cf0a9bf14 Fix shadow name warnings caused by addition of asio::query. 2020-11-02 12:23:26 +11:00
Christopher Kohlhoff
cec733bd5c Ensure executor concept tests for const-qualified execute(). 2020-11-02 12:23:08 +11:00
Christopher Kohlhoff
b3c8f8ed5e Revert "Restore null pointer check for better performance."
This reverts commit 50b38b57e6. This
change was applied in the wrong spot and introduced an uninitialised
memory access. The corresponding entry in the Revision History has
also been removed.
2020-08-11 09:33:07 +10:00
Christopher Kohlhoff
52a2f2ac59 Version bump. 2020-08-05 23:13:10 +10:00
Christopher Kohlhoff
06f8c1f98d Add shape_type and index_type to static_thread_pool executor, as per specification. 2020-08-04 12:52:40 +10:00
Christopher Kohlhoff
2f93fdb0c7 Prevent target-acquiring adapter constructors from being considered during overload resolution for conversion. 2020-08-01 11:25:31 +10:00
Christopher Kohlhoff
50b38b57e6 Restore null pointer check for better performance. 2020-08-01 11:24:36 +10:00
Christopher Kohlhoff
517e25cdcb Ensure concept-related traits work with void. 2020-07-31 18:47:51 +10:00
Christopher Kohlhoff
e53feeb5bf Add constraints to strand<>'s constructor to prevent template instantiation recursion. 2020-07-31 18:47:27 +10:00
Christopher Kohlhoff
0ccf4662cc Use constraints on any_executor's converting constructors, as per the specification. 2020-07-31 18:43:49 +10:00
Christopher Kohlhoff
e0cb6b1c11 Add short-circuiting to traits evaluation.
Test first for well-formed CPO expressions (or, in the case of senders,
a specialised sender_traits template) and, if not valid, short-circuit
the remainder of the traits evaluation. This helps prevent recursive
template instantiations that can occur in some contexts.
2020-07-31 18:43:38 +10:00
Christopher Kohlhoff
543c453423 Make blocking_t::always_t::is_preferable false as per specification. 2020-07-28 22:16:24 +10:00
Christopher Kohlhoff
db0d05de01 Fix typos. 2020-07-28 22:14:03 +10:00
Christopher Kohlhoff
bfdf118094 Fix reference to asio::query customisation point. 2020-07-28 22:12:31 +10:00
Christopher Kohlhoff
3ee1087d1c Add detailed descriptions for standard executor-related member functions. 2020-07-27 09:37:15 +10:00
Christopher Kohlhoff
60532356ff Fix up trait specialisations for use_future's executor. 2020-07-27 09:34:18 +10:00
Christopher Kohlhoff
2b200181e8 Fix executor_type definition in async_compose implementation. 2020-07-27 09:34:04 +10:00
Christopher Kohlhoff
badd16b2ff Fix detection of standard executors as I/O executors in async_compose. 2020-07-27 09:33:49 +10:00
Christopher Kohlhoff
55a6f4aefe Add workaround for coroutine argument capture problem in gcc 10. 2020-07-25 01:02:39 +10:00
Christopher Kohlhoff
6df0fc4e47 Fix typo in forward declaration of any_io_executor. 2020-07-25 01:02:23 +10:00
Christopher Kohlhoff
aa5a315a14 Add missing definition of BOOST_ASIO_EXECUTION_RECEIVER_OF_n macros. 2020-07-23 21:54:56 +10:00
Christopher Kohlhoff
d6c343b498 Add missing sender traits and connect() member to thread_pool executor. 2020-07-23 21:54:42 +10:00
Christopher Kohlhoff
95da815545 Add standard executor support to windows::overlapped_ptr. 2020-07-23 21:54:16 +10:00
Christopher Kohlhoff
bd20783944 Fix compatibility with clang-cl. 2020-07-23 21:53:52 +10:00
Christopher Kohlhoff
b54750e280 Add missing noexcept to basic_socket_acceptor move constructor. 2020-07-23 21:53:34 +10:00
Christopher Kohlhoff
db9a5c28e4 Fix mismatched comments. 2020-07-23 21:53:23 +10:00
Christopher Kohlhoff
d73cdc7db5 Fix namespace used for coroutine_traits specialisation. 2020-07-23 21:53:05 +10:00
Christopher Kohlhoff
71ae183e73 Destroy the awaitable's frame as the result is consumed.
This change works around a gcc 10 bug, where the temporary awaitable
object being awaited is not destroyed if the co_await resumes with an
exception.
2020-07-23 21:52:50 +10:00
Christopher Kohlhoff
42ec2bb656 Ensure traits specialisations are correctly enabled for the bulk_execute adapter. 2020-07-23 21:52:38 +10:00
Christopher Kohlhoff
740762b48f Pass receiver as a non-const lvalue when move support is unavailable. 2020-07-23 21:52:22 +10:00
Christopher Kohlhoff
cb75e92f14 No longer need to forward declare the io_context implementation. 2020-07-23 21:52:05 +10:00
Christopher Kohlhoff
eeb12fb723 Remove unused variable. 2020-07-23 21:51:49 +10:00
Christopher Kohlhoff
d69a55b338 Increase minimum gcc version required for SFINAEd variable templates. 2020-07-23 21:51:24 +10:00
Christopher Kohlhoff
2d27fc7123 Interim version bump. 2020-07-10 15:38:43 +10:00
Christopher Kohlhoff
ce4449c9c7 Add missing variadic pack expansion. 2020-07-10 14:36:20 +10:00
Christopher Kohlhoff
2b00773dad Ensure [[nodiscard]] is enabled only for C++17 or later. 2020-07-10 09:41:51 +10:00
Christopher Kohlhoff
cdae3445dd Add any_io_executor to ts/executor.hpp. 2020-07-10 09:41:35 +10:00
Christopher Kohlhoff
e2e2bfc006 Bump minimum gcc version for BOOST_ASIO_HAS_VARIABLE_TEMPLATES.
Require gcc 6 or later for C++14 variable templates, as gcc 5
has a bug when they are used as dependent names.
2020-07-09 23:18:06 +10:00