Skip to content

Declare threading contracts for collection owners - #5494

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

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

Conversation

@kennykerr

Copy link
Copy Markdown
Collaborator

Make the private collection owners carry the threading contract established by their factories, including derived owners. Update retirement probes to use thread-safe captures.

Preparation for #5469. Storage and public factory bounds are unchanged; the global IUnknownImpl bound stays out of this PR.

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.

🟢 Approval recommended

No active review issues remain for the changes making collection-owner threading contracts explicit.

No open issues 🎉

What changed in this PR

This PR makes factory-established threading contracts explicit on private windows-collections owners in preparation for #5469. Storage and public factory bounds remain unchanged; the global IUnknownImpl bound is outside this PR.

Changes:

  • Add Send and Sync declarations to collection owners and derived views, iterators, pairs, and event arguments.
  • Require VectorOwner implementations to be Send + Sync.
  • Update retirement probes to use thread-safe callbacks, synchronized observations, and typed owner captures.
File Description
crates/​libs/​collections/​src/​vector.rs Passes typed owners to vector retirement checks.
crates/​libs/​collections/​src/​vector_view.rs Declares threading contracts for vector views.
crates/​libs/​collections/​src/​vector_tests.rs Makes vector retirement probes thread-safe.
crates/​libs/​collections/​src/​storage.rs Documents factory contracts and declares vector storage threading traits.
crates/​libs/​collections/​src/​read_only_vector.rs Declares threading contracts for read-only vector owners.
crates/​libs/​collections/​src/​observable_vector.rs Passes typed owners to observable-vector retirement checks.
crates/​libs/​collections/​src/​observable_map.rs Declares map and event-argument threading traits; updates retirement checks.
crates/​libs/​collections/​src/​map.rs Declares map threading traits and updates retirement checks.
crates/​libs/​collections/​src/​map_view.rs Declares threading contracts for map views and snapshot iterators.
crates/​libs/​collections/​src/​map_tests.rs Makes value and key retirement probes thread-safe.
crates/​libs/​collections/​src/​key_value_pair.rs Declares threading contracts for derived key-value pairs.
crates/​libs/​collections/​src/​iterable.rs Declares threading contracts for immutable iterable owners.
crates/​libs/​collections/​src/​immutable_vector.rs Adds Send + Sync bounds to VectorOwner.

Review effort: Balanced

@kennykerr
Kenny Kerr (kennykerr) merged commit 0a952b0 into master Nov 25, 2026
51 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the collections-owner-threading branch November 25, 2026 16:48
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