Skip to content

Prepare Reactor COM owners for Send and Sync - #5495

Merged
Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
reactor-owner-threading
Nov 25, 2026
Merged

Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
reactor-owner-threading

Conversation

@kennykerr

Copy link
Copy Markdown
Collaborator

Keep element-factory state and launch callbacks in Reactor's existing UI-thread registry, with checked access and owner-thread cleanup. Use OnceLock for the metadata-provider cache.

Cover wrong-thread access, worker-thread release, and shutdown cancellation. Existing delegate dispatch is unchanged. This prepares Reactor for #5469 without enabling the global Send + Sync bound.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

COM-owner lifetime changes depend on WinUI dispatcher startup and shutdown ordering, but the required Windows test-reactor validation with COM diagnostics was unavailable during review.

No open issues 🎉

What changed in this PR

This PR prepares Reactor's COM owners for future Send + Sync requirements in #5469 without enabling the global bound or changing delegate dispatch.

Changes:

  • Move element-factory state and launch callbacks into the UI-thread registry with checked access and owner-thread cleanup.
  • Use OnceLock for metadata-provider caching and a mutex for drag-feedback state.
  • Add coverage for wrong-thread access, worker-thread release, and shutdown cancellation.
File Description
crates/​tests/​libs/​reactor/​src/​drag/​source.rs Protect drag-feedback state with a mutex.
crates/​tests/​libs/​reactor/​src/​callback_lifetime/​mod.rs Exercise COM access checks and capture cleanup across threads and shutdown.
crates/​tests/​libs/​reactor/​readme.md Document callback-lifetime coverage and its boundaries.
crates/​libs/​reactor/​src/​native/​winui/​virtualization.rs Keep element-factory state in the UI-thread registry.
crates/​libs/​reactor/​src/​native/​local.rs Add checked registry access and error-handling tests.
crates/​libs/​reactor/​src/​native/​app_shim.rs Use OnceLock caching and UI-owned launch callbacks.

Review effort: Balanced

@kennykerr
Kenny Kerr (kennykerr) merged commit bd711fb into master Nov 25, 2026
51 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the reactor-owner-threading branch November 25, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants