runtime
runtime copied to clipboard
Remove locks from COM events delegate management.
This removes locks and instead assumes the collection is immutable.
Fixes #73754
/cc @dotnet/interop-contrib
@stephentoub The CI is green. Any other thoughts?
Use array instead of List<T> Revert "Use array instead of List<T>"
Was there an actual problem or you did not like the result? (It looks better to me with arrays instead of List.)
Use array instead of List Revert "Use array instead of List"
Was there an actual problem or you did not like the result? (It looks better to me with arrays instead of List.)
It was an option. However, I needed to create a RemoveAll local with annoying logic so deferred to just using List<T>. Either works and appear correct, other than the "Remove" logic you pointed out above. Let me see about simplifying it further.
@jkotas @stephentoub I switched back to using arrays, let me know if you prefer List<T>. I also removed the Delegate.Combine logic. My biggest concern with changing that related to threading since this is a COM code path. Looking through it, I no longer have any concerns so it was removed.
/backport to release/7.0
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3108191020
/backport to release/6.0
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/3108193116