bindings: cxx: clarify the meaning of negative timeouts in event wait
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 23 May 2023 13:01:34 +0000 (15:01 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 23 May 2023 13:01:34 +0000 (15:01 +0200)
chip::wait_info_event() and line_request::wait_edge_events() behave the
same as their C counterparts in that they block indefinitely when passed
a negative timeout value. State it explicitly in the docs.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
bindings/cxx/gpiodcxx/chip.hpp
bindings/cxx/gpiodcxx/line-request.hpp

index 2553f8c90e056d090f8d2acc5cfd018a9ebbf03f..e8b3c0f3ccab2bb094fcd4b8adbabb205ddb8bf2 100644 (file)
@@ -125,7 +125,10 @@ public:
        /**
         * @brief Wait for line status events on any of the watched lines
         *        exposed by this chip.
-        * @param timeout Wait time limit in nanoseconds.
+        * @param timeout Wait time limit in nanoseconds. If set to 0, the
+        *                function returns immediatelly. If set to a negative
+        *                number, the function blocks indefinitely until an
+        *                event becomes available.
         * @return True if at least one event is ready to be read. False if the
         *         wait timed out.
         */
index 54a4e00ae03513a0da75effe7de7c65c6b7d514e..c1e1520a8b42d96cc8f74cf470c71f30c9f54b0d 100644 (file)
@@ -176,7 +176,10 @@ public:
        /**
         * @brief Wait for edge events on any of the lines requested with edge
         *        detection enabled.
-        * @param timeout Wait time limit in nanoseconds.
+        * @param timeout Wait time limit in nanoseconds. If set to 0, the
+        *                function returns immediatelly. If set to a negative
+        *                number, the function blocks indefinitely until an
+        *                event becomes available.
         * @return True if at least one event is ready to be read. False if the
         *         wait timed out.
         */