Skip to content

Commit 47b2611

Browse files
Merge pull request #7 from connectivecpp/develop
Merge develop to main
2 parents 6c2d505 + 1e1125d commit 47b2611

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎include/queue/wait_queue.hpp‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/** @mainpage Wait Queue, a Multi-Writer / Multi-Reader (MPMC) Thread-Safe Queue
2+
*
3+
* ## Overview
24
*
35
* This class allows transferring data between threads with queue semantics (push, pop),
46
* using C++ std library general facilities (mutex, condition variable). An internal
@@ -52,7 +54,7 @@
5254
* the API is significantly changed and additional features added. The name of the utility
5355
* class template in Anthony's book is @c threadsafe_queue.
5456
*
55-
* Additional details:
57+
* ### Additional Details
5658
*
5759
* Each method is fully documented in the class documentation. In particular, function
5860
* arguments, pre-conditions, and return values are all documented.
@@ -301,6 +303,11 @@ class wait_queue {
301303
*
302304
* For an internal @c std::stop_token, all waiting reader threaders will be notified.
303305
* Subsequent @c push operations will return @c false.
306+
*
307+
* @return @c true if an internal @c stop_source was used (versus a @c std::stop_token
308+
* passed in to the constructor) and the request returns @c true, @c false if an
309+
* external @c std::stop_token was passed in.
310+
*
304311
*/
305312
bool request_stop() noexcept {
306313
if (m_stop_src) {
@@ -396,7 +403,8 @@ class wait_queue {
396403
* available, otherwise return an empty @c std::optional.
397404
*
398405
* @return A value from the @c wait_queue or an empty @c std::optional if no values are
399-
* available in the @c wait_queue.
406+
* available in the @c wait_queue or if the @c wait_queue has been requested to be
407+
* stopped .
400408
*/
401409
std::optional<T> try_pop() /* noexcept(std::is_nothrow_constructible<T>::value) */ {
402410
if (m_stop_tok.stop_requested()) {
@@ -447,7 +455,7 @@ class wait_queue {
447455
}
448456

449457
/**
450-
* Query whether a @ request_stop method (passed through a @c stop_token) has been called on
458+
* Query whether a @ request_stop method has been called on
451459
* the @c wait_queue.
452460
*
453461
* @return @c true if the @c stop_requested has been called.

0 commit comments

Comments
 (0)