[PATCH] bindings: cxx: clarify the meaning of negative timeouts in event wait

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 bindings/cxx/gpiodcxx/chip.hpp         | 5 ++++-
 bindings/cxx/gpiodcxx/line-request.hpp | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/bindings/cxx/gpiodcxx/chip.hpp b/bindings/cxx/gpiodcxx/chip.hpp
index 2553f8c..e8b3c0f 100644
--- a/bindings/cxx/gpiodcxx/chip.hpp
+++ b/bindings/cxx/gpiodcxx/chip.hpp
@@ -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.
 	 */
diff --git a/bindings/cxx/gpiodcxx/line-request.hpp b/bindings/cxx/gpiodcxx/line-request.hpp
index 54a4e00..c1e1520 100644
--- a/bindings/cxx/gpiodcxx/line-request.hpp
+++ b/bindings/cxx/gpiodcxx/line-request.hpp
@@ -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.
 	 */
-- 
2.39.2




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux