Skip to content

Commit a968852

Browse files
committed
Add documentation note on basic_signal_set's async signal safety.
1 parent 7f60f27 commit a968852

5 files changed

Lines changed: 34 additions & 4 deletions

File tree

doc/reference.dox

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ INPUT = ./../../../boost/asio.hpp \
127127
./../../../boost/asio/experimental \
128128
./model_dox.txt \
129129
./noncopyable_dox.txt \
130+
./requirements_dox.txt \
130131
./std_exception_dox.txt
131132
INPUT_ENCODING = UTF-8
132133
INPUT_FILE_ENCODING =

doc/reference.qbk

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6227,7 +6227,7 @@ The [link boost_asio.reference.async_result `async_result`] trait is a customisa
62276227

62286228
* the operation's internal implementation.
62296229

6230-
Specialisations of the trait must satisfy the async\_result\_requirements, and are reponsible for determining:
6230+
Specialisations of the trait must satisfy the [link boost_asio.reference.asynchronous_operations.completion_tokens_and_handlers async_result requirements], and are reponsible for determining:
62316231

62326232

62336233
* the concrete completion handler type to be called at the end of the asynchronous operation;
@@ -6246,7 +6246,7 @@ This template may be specialised for user-defined completion token types. The pr
62466246

62476247
[heading Remarks]
62486248

6249-
For backwards compatibility, the primary template implements member types and functions that are associated with legacy forms of the [link boost_asio.reference.async_result `async_result`] trait. These are annotated as "Legacy" in the documentation below. User specialisations of this trait do not need to implement these in order to satisfy the async\_result\_requirements.
6249+
For backwards compatibility, the primary template implements member types and functions that are associated with legacy forms of the [link boost_asio.reference.async_result `async_result`] trait. These are annotated as "Legacy" in the documentation below. User specialisations of this trait do not need to implement these in order to satisfy the [link boost_asio.reference.asynchronous_operations.completion_tokens_and_handlers async_result requirements].
62506250

62516251
In general, implementers of asynchronous operations should use the async\_initiate function rather than using the [link boost_asio.reference.async_result `async_result`] trait directly.
62526252

@@ -10405,7 +10405,7 @@ The [link boost_asio.reference.async_result `async_result`] trait is a customisa
1040510405

1040610406
* the operation's internal implementation.
1040710407

10408-
Specialisations of the trait must satisfy the async\_result\_requirements, and are reponsible for determining:
10408+
Specialisations of the trait must satisfy the [link boost_asio.reference.asynchronous_operations.completion_tokens_and_handlers async_result requirements], and are reponsible for determining:
1040910409

1041010410

1041110411
* the concrete completion handler type to be called at the end of the asynchronous operation;
@@ -10424,7 +10424,7 @@ This template may be specialised for user-defined completion token types. The pr
1042410424

1042510425
[heading Remarks]
1042610426

10427-
For backwards compatibility, the primary template implements member types and functions that are associated with legacy forms of the [link boost_asio.reference.async_result `async_result`] trait. These are annotated as "Legacy" in the documentation below. User specialisations of this trait do not need to implement these in order to satisfy the async\_result\_requirements.
10427+
For backwards compatibility, the primary template implements member types and functions that are associated with legacy forms of the [link boost_asio.reference.async_result `async_result`] trait. These are annotated as "Legacy" in the documentation below. User specialisations of this trait do not need to implement these in order to satisfy the [link boost_asio.reference.asynchronous_operations.completion_tokens_and_handlers async_result requirements].
1042810428

1042910429
In general, implementers of asynchronous operations should use the async\_initiate function rather than using the [link boost_asio.reference.async_result `async_result`] trait directly.
1043010430

@@ -43783,6 +43783,11 @@ This asynchronous operation supports cancellation for the following [link boost_
4378343783
* `cancellation_type::total`
4378443784

4378543785

43786+
[heading Remarks]
43787+
43788+
Unlike the POSIX function `signal`, `async_wait` executes its completion handler as specified in the [link boost_asio.reference.asynchronous_operations asynchronous operation requirements]. This means it places no async-signal safety restrictions on what work can be performed in a completion handler.
43789+
43790+
4378643791

4378743792

4378843793
[endsect]

doc/reference.xsl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,11 @@
734734
<xsl:value-of select="."/>
735735
<xsl:text>]</xsl:text>
736736
</xsl:when>
737+
<xsl:when test="@refid = 'async_op_requirements'">
738+
<xsl:text>[link boost_asio.reference.asynchronous_operations </xsl:text>
739+
<xsl:value-of select="."/>
740+
<xsl:text>]</xsl:text>
741+
</xsl:when>
737742
<xsl:when test="@refid = 'async_result_requirements'">
738743
<xsl:text>[link boost_asio.reference.asynchronous_operations.completion_tokens_and_handlers </xsl:text>
739744
<xsl:value-of select="."/>

doc/requirements_dox.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com)
3+
//
4+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
5+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6+
//
7+
8+
/**
9+
\page async_op_requirements asynchronous operation requirements
10+
*/
11+
12+
/**
13+
\page async_result_requirements @c async_result requirements
14+
*/

include/boost/asio/basic_signal_set.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,11 @@ class basic_signal_set : public signal_set_base
588588
* @li @c cancellation_type::partial
589589
*
590590
* @li @c cancellation_type::total
591+
*
592+
* @note Unlike the POSIX function @c signal, @c async_wait executes its
593+
* completion handler as specified in the @ref async_op_requirements. This
594+
* means it places no async-signal safety restrictions on what work can be
595+
* performed in a completion handler.
591596
*/
592597
template <
593598
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code, int))

0 commit comments

Comments
 (0)