Re: [PATCH v4 3/3] rust: workqueue: add creation of workqueues
From: Danilo Krummrich
Date: Thu Mar 12 2026 - 14:03:16 EST
On Thu Mar 12, 2026 at 10:23 AM CET, Alice Ryhl wrote:
> +impl Queue {
> + /// Build a workqueue whose work may execute on any cpu.
> + ///
> + /// # Examples
> + ///
> + /// ```
> + /// use kernel::workqueue::Queue;
> + ///
> + /// let wq = Queue::new_unbound().build(c"my-wq")?;
> + /// wq.try_spawn(GFP_KERNEL, || pr_info!("Hello from unbound wq"))?;
> + /// # Ok::<(), Error>(())
> + /// ```
> + #[inline]
> + #[doc(alias = "WQ_UNBOUND")]
> + pub fn new_unbound() -> Builder<TypeUnbound> {
Wouldn't it be more straight forward if those where constructors of Builder?
let wq = wq::Builder::new_unbound().build(c"my-wq")?;
Queue::new_unbound() suggests that it returns a new Queue object, but instead it
returns a new Builder object.