microsoft / windows-rs

Rust for Windows
https://kennykerr.ca/rust-getting-started/
Apache License 2.0
10.1k stars 473 forks source link

Send and Sync for Weak reference #3137

Closed lifers closed 5 days ago

lifers commented 1 week ago

Suggestion

Is there any danger in assuming Send and Sync for types that contain windows_core::Weak? In comparison, std::sync::Weak is Send and Sync.

If it's safe, I'd like it to be implemented directly in the windows_core::Weak definition. Thanks!

kennykerr commented 6 days ago

Yep, IWeakReference and IWeakReferenceSource are designed and implemented to be completely thread safe.