|
1 | 1 | /** @mainpage Wait Queue, a Multi-Writer / Multi-Reader (MPMC) Thread-Safe Queue |
| 2 | + * |
| 3 | + * ## Overview |
2 | 4 | * |
3 | 5 | * This class allows transferring data between threads with queue semantics (push, pop), |
4 | 6 | * using C++ std library general facilities (mutex, condition variable). An internal |
|
52 | 54 | * the API is significantly changed and additional features added. The name of the utility |
53 | 55 | * class template in Anthony's book is @c threadsafe_queue. |
54 | 56 | * |
55 | | - * Additional details: |
| 57 | + * ### Additional Details |
56 | 58 | * |
57 | 59 | * Each method is fully documented in the class documentation. In particular, function |
58 | 60 | * arguments, pre-conditions, and return values are all documented. |
@@ -301,6 +303,11 @@ class wait_queue { |
301 | 303 | * |
302 | 304 | * For an internal @c std::stop_token, all waiting reader threaders will be notified. |
303 | 305 | * 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 | + * |
304 | 311 | */ |
305 | 312 | bool request_stop() noexcept { |
306 | 313 | if (m_stop_src) { |
@@ -396,7 +403,8 @@ class wait_queue { |
396 | 403 | * available, otherwise return an empty @c std::optional. |
397 | 404 | * |
398 | 405 | * @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 . |
400 | 408 | */ |
401 | 409 | std::optional<T> try_pop() /* noexcept(std::is_nothrow_constructible<T>::value) */ { |
402 | 410 | if (m_stop_tok.stop_requested()) { |
@@ -447,7 +455,7 @@ class wait_queue { |
447 | 455 | } |
448 | 456 |
|
449 | 457 | /** |
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 |
451 | 459 | * the @c wait_queue. |
452 | 460 | * |
453 | 461 | * @return @c true if the @c stop_requested has been called. |
|
0 commit comments