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. 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.