Commit Graph

2760 Commits

Author SHA1 Message Date
Kira M. Backes
82887fe49f Improve build doc discoverability 2020-11-29 11:40:42 +11:00
Christopher Kohlhoff
4a2c74ee0b Add auto-generated documentation for compiler/platform feature macros. 2020-11-29 11:35:42 +11:00
Christopher Kohlhoff
5fb2ea03ac Add compatibility between polymorphic executors and the (deprecated) handler invocation hook. 2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
a8e4084431 More support for detecting handlers that have no custom executor. 2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
525c4203aa Add workarounds for the Intel C++ compiler. 2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
9df90e749e Require non-conversion for at least one argument to any_executor comparisons. 2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
c4973d222d Restore null pointer check for better performance. 2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
34c39d923d Enable UNIX domain sockets for Windows.
From Windows 10, UNIX domain sockets (a.k.a "local" sockets) are
supported on Windows, with the exception of the connect_pair
function (which will fail with an operation_not_supported error).
2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
e759dc58b0 Fix name of std_event::unlock_and_signal_one_for_destruction(). 2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
f5ca0e1863 Fix error_code assign() in inet_pton emulation for WinRT. 2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
44d3ff6b54 Add executor-converting construction/assignment to ip::basic_resolver. 2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
b8e9a44868 Add experimental::as_single completion token adapter.
The as_single completion token adapter can be used to specify that the
completion handler arguments should be combined into a single argument.
For completion signatures with a single parameter, the argument is
passed through as-is. For signatures with two or more parameters, the
arguments are combined into a tuple.

The as_single adapter may be used in conjunction with use_awaitable and
structured bindings as follows:

    auto [e, n] = co_await socket.async_read_some(
        asio::buffer(data), as_single(use_awaitable));

Alternatively, it may be used as a default completion token like so:

    using default_token = as_single_t<use_awaitable_t<>>;
    using tcp_socket = default_token::as_default_on_t<tcp::socket>;
    // ...
    awaitable<void> do_read(tcp_socket socket)
    {
      // ...
      auto [e, n] = co_await socket.async_read_some(asio::buffer(data));
      // ...
    }
2020-11-02 14:00:33 +11:00
Christopher Kohlhoff
ed5b117546 Clarify when the select reactor is used on Windows. 2020-11-02 14:00:33 +11:00
Nick Gasson
629591e8f2 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:00:33 +11:00
Lucian Petrut
b81358a9d4 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
ASIO_HAS_PTHREADS is set.
2020-11-02 14:00:33 +11:00
Andre Schröder
0e09f69102 Fix typo GENERATION_DOCUMENTATION 2020-11-02 14:00:33 +11:00
Josh Pieper
b683aed423 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:00:33 +11:00
pianofab
65b210f163 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:00:33 +11:00
Christopher Kohlhoff
7e4df5a9df Fix thread_pool test to work with ASIO_NO_TYPEID (i.e. no RTTI). 2020-11-02 14:00:32 +11:00
Christopher Kohlhoff
8810b3d2ae Fix any_executor support for ASIO_NO_TYPEID (i.e. no RTTI). 2020-11-02 14:00:32 +11:00
Christopher Kohlhoff
a65c59bb53 Cast to void to fix comma-operator warning. 2020-11-02 14:00:32 +11:00
Christopher Kohlhoff
f94f2e214c Remove redundant semicolons. 2020-11-02 14:00:32 +11:00
Christopher Kohlhoff
294a77562c Suppress zero-as-null-pointer-constant warnings. 2020-11-02 14:00:32 +11:00
Christopher Kohlhoff
5d71acb87e Add missing push/pop_options.hpp includes. 2020-11-02 10:23:03 +11:00
Christopher Kohlhoff
1f6c91d26a Fix (benign) switch fallthrough warning. 2020-11-02 10:23:03 +11:00
Christopher Kohlhoff
d385805d0e Fix "logical ‘or’ of equal expressions" warning on linux. 2020-11-02 10:23:03 +11:00
Christopher Kohlhoff
f31bad86af Fix shadow name warnings caused by addition of asio::query. 2020-11-02 10:23:03 +11:00
Christopher Kohlhoff
e91649af0c Ensure executor concept tests for const-qualified execute(). 2020-11-02 10:23:03 +11:00
Christopher Kohlhoff
be7badc31a asio version 1.18.0 released 2020-08-15 12:01:26 +10:00
Christopher Kohlhoff
1233ad3747 Revision history. 2020-08-15 11:12:46 +10:00
Christopher Kohlhoff
c9a4223dd9 Revert "Restore null pointer check for better performance."
This reverts commit 388a04cdc1. This
change was applied in the wrong spot and introduced an uninitialised
memory access.
2020-08-11 09:53:37 +10:00
Christopher Kohlhoff
01b4e87c04 Add some basic documentation on standard executors support. 2020-08-05 23:14:08 +10:00
Christopher Kohlhoff
4be31df55d Document that there are multiple types of I/O execution context. 2020-08-05 10:39:19 +10:00
Christopher Kohlhoff
0418d12c04 Clarify impact of any_io_executor change. 2020-08-05 10:04:18 +10:00
Christopher Kohlhoff
331d28d98a Add shape_type and index_type to static_thread_pool executor, as per specification. 2020-08-04 08:30:38 +10:00
Christopher Kohlhoff
38fda8db75 Prevent target-acquiring adapter constructors from being considered during overload resolution for conversion. 2020-08-01 01:02:47 +10:00
Christopher Kohlhoff
388a04cdc1 Restore null pointer check for better performance. 2020-07-31 21:53:54 +10:00
Christopher Kohlhoff
b7bdff6cd1 Ensure concept-related traits work with void. 2020-07-31 15:22:32 +10:00
Christopher Kohlhoff
ed7422dbb4 Add constraints to strand<>'s constructor to prevent template instantiation recursion. 2020-07-31 15:22:32 +10:00
Christopher Kohlhoff
83e28babbe Use constraints on any_executor's converting constructors, as per the specification. 2020-07-31 15:22:32 +10:00
Christopher Kohlhoff
db3e9dcb40 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 15:20:57 +10:00
Christopher Kohlhoff
7864772dd8 Mark constructors in synopses for nested classes and classes in sub-namespaces. 2020-07-30 10:14:48 +10:00
Christopher Kohlhoff
4b4fd81b8d Make blocking_t::always_t::is_preferable false as per specification. 2020-07-28 19:50:09 +10:00
Christopher Kohlhoff
234f230490 Fix typos. 2020-07-28 13:31:23 +10:00
Christopher Kohlhoff
51842da799 Fix reference to asio::query customisation point. 2020-07-28 12:59:41 +10:00
Christopher Kohlhoff
ab336ac55b Exclude I/O objects' impl_ data members from documentation. 2020-07-28 12:59:41 +10:00
Christopher Kohlhoff
204955ddcf Mark constructors/destructors in class synopses. 2020-07-28 12:59:41 +10:00
Christopher Kohlhoff
0acfaad9bc Mark static members in class synopses. 2020-07-28 12:59:41 +10:00
Christopher Kohlhoff
019c09dd4b Add detailed descriptions for standard executor-related member functions. 2020-07-27 09:21:23 +10:00
Christopher Kohlhoff
b4dcc70225 Documentation generation tweaks. 2020-07-25 12:46:53 +10:00