From a9fc17e448473a5a69aff0b55d1b73d8fb2d0131 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 11 Apr 2025 09:07:57 +0200 Subject: [PATCH 1/2] work: WorkQueueBuilder: update to include work_timeout_ms member. The k_work_q has been extended with a new feature, the work timeout, which comes with a new field to k_work_queue_config, work_timeout_ms, which must be initialized. Signed-off-by: Bjarki Arge Andreasen --- zephyr/src/work.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zephyr/src/work.rs b/zephyr/src/work.rs index 17e28e0..9e390a2 100644 --- a/zephyr/src/work.rs +++ b/zephyr/src/work.rs @@ -138,6 +138,7 @@ //! .set_priority(2). //! .set_name(c"mainloop") //! .set_no_yield(true) +//! .set_work_timeout_ms(1000) //! .start(MAIN_LOOP_STACK.init_once(()).unwrap()) //! ); //! @@ -220,6 +221,7 @@ impl WorkQueueBuilder { name: ptr::null(), no_yield: false, essential: false, + work_timeout_ms: 0, }, priority: 0, } @@ -255,6 +257,18 @@ impl WorkQueueBuilder { self } + /// Controls whether work queue monitors work timeouts. + /// + /// If non-zero, and CONFIG_WORKQUEUE_WORK_TIMEOUT is enabled, + /// the work queue will monitor the duration of each work item. + /// If the work item handler takes longer than the specified + /// time to execute, the work queue thread will be aborted, and + /// an error will be logged if CONFIG_LOG is enabled. + pub fn set_work_timeout_ms(&mut self, value: u32) -> &mut Self { + self.config.work_timeout_ms = value; + self + } + /// Set the priority for the worker thread. /// /// See the Zephyr docs for the meaning of priority. From f55ed07969a93f73402239c5ece8ffd8fe1c01c3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 11 Apr 2025 12:49:50 +0200 Subject: [PATCH 2/2] ci-manifest: point to zephyr PR Need to point to zephyr PR to align zephyr API with WorkQueueBuilder. Signed-off-by: Bjarki Arge Andreasen --- ci-manifest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-manifest.yml b/ci-manifest.yml index 20f8a04..750823f 100644 --- a/ci-manifest.yml +++ b/ci-manifest.yml @@ -12,7 +12,7 @@ manifest: projects: - name: zephyr remote: zephyrproject-rtos - revision: main + revision: pull/88345/head import: # By using name-allowlist we can clone only the modules that are # strictly needed by the application.