The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: <tj@kernel.org>, <jiangshanlai@gmail.com>, <aliceryhl@google.com>,
	<ojeda@kernel.org>, <boqun@kernel.org>, <gary@garyguo.net>,
	<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
	<a.hindborg@kernel.org>, <tmgross@umich.edu>,
	<daniel.almeida@collabora.com>, <tamird@kernel.org>,
	<acourbot@nvidia.com>, <work@onurozkan.dev>,
	<jhubbard@nvidia.com>
Cc: <rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<driver-core@lists.linux.dev>
Subject: Re: [PATCH v2 6/6] rust: workqueue: add ScopedWork for non-'static work items
Date: Fri, 07 Aug 2026 20:35:15 +0200	[thread overview]
Message-ID: <DKIXFKSP5V1U.12MPGENL0S0N1@kernel.org> (raw)
In-Reply-To: <20260807165252.3849875-7-dakr@kernel.org>

On Fri Aug 7, 2026 at 6:52 PM CEST, Danilo Krummrich wrote:
> +#[pinned_drop]
> +impl<T: ScopedWorkItem> PinnedDrop for ScopedWork<T> {
> +    #[inline]
> +    fn drop(self: Pin<&mut Self>) {
> +        let inner = self.inner.get();
> +
> +        // SAFETY: `inner` points to a valid `ScopedWorkRef`. After `cancel_work_sync()` returns,
> +        // the work function is guaranteed to not be running.
> +        unsafe { bindings::cancel_work_sync(Work::raw_get(&raw const (*inner).work)) };

	// SAFETY: `inner` is valid and no longer accessed by the work function.
	unsafe { core::ptr::drop_in_place(inner) };

> +    }
> +}

      reply	other threads:[~2026-08-07 18:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 16:52 [PATCH v2 0/6] workqueue: OwnedQueue, ScopedQueue and ScopedWork Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 1/6] rust: workqueue: replace deprecated system_wq with system_{percpu,dfl}_wq Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 2/6] rust: workqueue: restrict delayed work to global wqs Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 3/6] rust: workqueue: create workqueue subdirectory Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 4/6] rust: workqueue: add creation of workqueues Danilo Krummrich
2026-08-07 22:39   ` Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 5/6] rust: workqueue: add ScopedQueue for lifetime bound items Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 6/6] rust: workqueue: add ScopedWork for non-'static work items Danilo Krummrich
2026-08-07 18:35   ` Danilo Krummrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DKIXFKSP5V1U.12MPGENL0S0N1@kernel.org \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tj@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox